]> granicus.if.org Git - clang/commitdiff
Correct typos in SEH filter expressions
authorReid Kleckner <reid@kleckner.net>
Thu, 2 Apr 2015 22:09:32 +0000 (22:09 +0000)
committerReid Kleckner <reid@kleckner.net>
Thu, 2 Apr 2015 22:09:32 +0000 (22:09 +0000)
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

lib/Parse/ParseStmt.cpp
test/Sema/__try.c

index d15f2af65eb28a4fd633d537085703fcc8f3f456..c31216d0ae277bdbe2c44237df694e4b266ebbd1 100644 (file)
@@ -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) {
index 925dbcc55ef1fe99197b261af067c007813ca99c..8be93ddaeebd0d38c958e7610ab6df612585e016 100644 (file)
@@ -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}}
+  }
+}