From: Reid Kleckner Date: Thu, 2 Apr 2015 22:09:32 +0000 (+0000) Subject: Correct typos in SEH filter expressions X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=86e816057520006b3312e6faf6cc2ac1c8618583;p=clang Correct typos in SEH filter expressions Otherwise we assert due to uncorrected delayed typos. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233980 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp index d15f2af65e..c31216d0ae 100644 --- a/lib/Parse/ParseStmt.cpp +++ b/lib/Parse/ParseStmt.cpp @@ -476,7 +476,7 @@ StmtResult Parser::ParseSEHExceptBlock(SourceLocation ExceptLoc) { { ParseScopeFlags FilterScope(this, getCurScope()->getFlags() | Scope::SEHFilterScope); - FilterExpr = ParseExpression(); + FilterExpr = Actions.CorrectDelayedTyposInExpr(ParseExpression()); } if (getLangOpts().Borland) { diff --git a/test/Sema/__try.c b/test/Sema/__try.c index 925dbcc55e..8be93ddaee 100644 --- a/test/Sema/__try.c +++ b/test/Sema/__try.c @@ -281,3 +281,9 @@ void test_jump_out_of___finally() { }(); } } + +void test_typo_in_except() { + __try { + } __except(undeclared_identifier) { // expected-error {{use of undeclared identifier 'undeclared_identifier'}} expected-error {{expected expression}} + } +}