the scope checker does work with objc methods, add testcase.

llvm-svn: 69487
This commit is contained in:
Chris Lattner 2009-04-18 22:37:38 +00:00
parent b6e368235a
commit 508253d64b
2 changed files with 15 additions and 7 deletions

View File

@ -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:

View File

@ -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