aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-18 22:37:38 +0000
committerChris Lattner <sabre@nondot.org>2009-04-18 22:37:38 +0000
commit5223af8f05eff78bfba57cb154e28fb9def97b45 (patch)
treec9634bc91f9fbc9c6808be35843362be9993b3e0
parentdabbad04ee3173f76b324d3825ede0287a304022 (diff)
the scope checker does work with objc methods, add testcase.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69487 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaDecl.cpp5
-rw-r--r--test/SemaObjC/scope-check.m17
2 files changed, 15 insertions, 7 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 9cc7c6bf6b..abc508916f 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -2908,11 +2908,6 @@ Sema::DeclPtrTy Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, DeclPtrTy D) {
/// TODO: statement expressions, for (int x[n]; ;), case.
-/// TODO: check the body of an objc method.
-
-// TODO: Consider wording like: "branching bypasses declaration of
-// variable-length"
-
/// JumpScopeChecker - This object is used by Sema to diagnose invalid jumps
/// into VLA and other protected scopes. For example, this rejects:
diff --git a/test/SemaObjC/scope-check.m b/test/SemaObjC/scope-check.m
index fb9bd4570d..6659562bab 100644
--- a/test/SemaObjC/scope-check.m
+++ b/test/SemaObjC/scope-check.m
@@ -44,8 +44,6 @@ L3: ;
} @catch (C *c) { // expected-note {{jump bypasses initialization of @catch block}}
L8: ;
}
-
-
}
void test2(int a) {
@@ -62,3 +60,18 @@ void test3() {
blargh: ;
} @catch (...) {}
}
+
+@interface Greeter
++ (void) hello;
+@end
+
+@implementation Greeter
++ (void) hello {
+
+ @try {
+ goto blargh; // expected-error {{illegal goto into protected scope}}
+ } @catch (...) { // expected-note {{jump bypasses initialization of @catch block}}
+ blargh: ;
+ }
+}
+@end