From: Kaelyn Takata Date: Fri, 19 Dec 2014 01:28:40 +0000 (+0000) Subject: Correct delayed typos in the operand to typeof expressions. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0ef7967c69d45880fc3ca23ab8397a585814b4bb;p=clang Correct delayed typos in the operand to typeof expressions. Fixes PR21947. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224558 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 0b84f2fbbd..888e8eea25 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -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); diff --git a/test/SemaCXX/typo-correction-delayed.cpp b/test/SemaCXX/typo-correction-delayed.cpp index a9bc91e030..49bb14fe8c 100644 --- a/test/SemaCXX/typo-correction-delayed.cpp +++ b/test/SemaCXX/typo-correction-delayed.cpp @@ -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'?}} +}