]> granicus.if.org Git - clang/commitdiff
Enter a new scope for a @try block.
authorTed Kremenek <kremenek@apple.com>
Fri, 26 Sep 2008 17:32:47 +0000 (17:32 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 26 Sep 2008 17:32:47 +0000 (17:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56668 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseObjc.cpp
test/Sema/rdar6248119.m

index 17488d523e4d6e44fec13f6f58a7b1e2e90e3c16..c48cc8aa1ab4aa4ddff250e200d2be31431f3451 100644 (file)
@@ -1253,7 +1253,9 @@ Parser::StmtResult Parser::ParseObjCTryStmt(SourceLocation atLoc) {
   }
   StmtResult CatchStmts;
   StmtResult FinallyStmt;
+  EnterScope(Scope::DeclScope);
   StmtResult TryBody = ParseCompoundStatementBody();
+  ExitScope();
   if (TryBody.isInvalid)
     TryBody = Actions.ActOnNullStmt(Tok.getLocation());
   
index fbfa1e3af3bc2d3bed7bbd31bc11778484c337bd..ff402b296d842f0f1e83f128fb2948f3f09d2a50 100644 (file)
@@ -9,3 +9,19 @@ void f0() {
     int i = 0;
   }
 }
+
+void f1() {
+  int i;
+  @try { 
+    int i =0;
+  } @finally {
+  }
+}
+
+void f2() {
+  int i;
+  @try { 
+  } @catch(id e) {
+    int i = 0;
+  }
+}