Correct delayed typos in the operand to typeof expressions.

Fixes PR21947.

llvm-svn: 224558
This commit is contained in:
Kaelyn Takata 2014-12-19 01:28:40 +00:00
parent 97f7685516
commit 9112607400
2 changed files with 7 additions and 2 deletions

View File

@ -5932,8 +5932,8 @@ void Parser::ParseTypeofSpecifier(DeclSpec &DS) {
bool isCastExpr;
ParsedType CastTy;
SourceRange CastRange;
ExprResult Operand = ParseExprAfterUnaryExprOrTypeTrait(OpTok, isCastExpr,
CastTy, CastRange);
ExprResult Operand = Actions.CorrectDelayedTyposInExpr(
ParseExprAfterUnaryExprOrTypeTrait(OpTok, isCastExpr, CastTy, CastRange));
if (hasParens)
DS.setTypeofParensRange(CastRange);

View File

@ -147,3 +147,8 @@ void test() {
namespace PR21905 {
int (*a) () = (void)Z; // expected-error-re {{use of undeclared identifier 'Z'{{$}}}}
}
namespace PR21947 {
int blue; // expected-note {{'blue' declared here}}
__typeof blur y; // expected-error {{use of undeclared identifier 'blur'; did you mean 'blue'?}}
}