forked from OSchip/llvm-project
				
			Preserve invalidity of typeof operands in C++.
llvm-svn: 111999
This commit is contained in:
		
							parent
							
								
									45140a9040
								
							
						
					
					
						commit
						3669c80de9
					
				| 
						 | 
				
			
			@ -1166,7 +1166,8 @@ Parser::ParseExprAfterTypeofSizeofAlignof(const Token &OpTok,
 | 
			
		|||
      // sizeof/alignof or in C++. Therefore, the parenthesized expression is
 | 
			
		||||
      // the start of a unary-expression, but doesn't include any postfix 
 | 
			
		||||
      // pieces. Parse these now if present.
 | 
			
		||||
      Operand = ParsePostfixExpressionSuffix(Operand.take());
 | 
			
		||||
      if (!Operand.isInvalid())
 | 
			
		||||
        Operand = ParsePostfixExpressionSuffix(Operand.get());
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,3 +5,9 @@ static void test() {
 | 
			
		|||
  int x;
 | 
			
		||||
  typeof pi[x] y; 
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Part of rdar://problem/8347416;  from the gcc test suite.
 | 
			
		||||
struct S {
 | 
			
		||||
  int i;
 | 
			
		||||
  __typeof(S::i) foo(); // expected-error {{invalid use of nonstatic data member 'i'}}
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue