diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-09-26 17:32:47 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-09-26 17:32:47 +0000 |
commit | 3527b59f246cde170e6877e3e62f78a95dbcdfce (patch) | |
tree | bc7c5dbe27bc3e1e97660765787d20b6e4bad219 | |
parent | 640c14c1f76d456355a36ecb3094bc0950836ff8 (diff) |
Enter a new scope for a @try block.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56668 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Parse/ParseObjc.cpp | 2 | ||||
-rw-r--r-- | test/Sema/rdar6248119.m | 16 |
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp index 17488d523e..c48cc8aa1a 100644 --- a/lib/Parse/ParseObjc.cpp +++ b/lib/Parse/ParseObjc.cpp @@ -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()); diff --git a/test/Sema/rdar6248119.m b/test/Sema/rdar6248119.m index fbfa1e3af3..ff402b296d 100644 --- a/test/Sema/rdar6248119.m +++ b/test/Sema/rdar6248119.m @@ -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; + } +} |