[cfe-commits] r69487 - in /cfe/trunk: lib/Sema/SemaDecl.cpp test/SemaObjC/scope-check.m

Chris Lattner sabre at nondot.org
Sat Apr 18 15:37:38 PDT 2009


Author: lattner
Date: Sat Apr 18 17:37:38 2009
New Revision: 69487

URL: http://llvm.org/viewvc/llvm-project?rev=69487&view=rev
Log:
the scope checker does work with objc methods, add testcase.

Modified:
    cfe/trunk/lib/Sema/SemaDecl.cpp
    cfe/trunk/test/SemaObjC/scope-check.m

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=69487&r1=69486&r2=69487&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Sat Apr 18 17:37:38 2009
@@ -2908,11 +2908,6 @@
 
 
 /// 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:

Modified: cfe/trunk/test/SemaObjC/scope-check.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/scope-check.m?rev=69487&r1=69486&r2=69487&view=diff

==============================================================================
--- cfe/trunk/test/SemaObjC/scope-check.m (original)
+++ cfe/trunk/test/SemaObjC/scope-check.m Sat Apr 18 17:37:38 2009
@@ -44,8 +44,6 @@
   } @catch (C *c) { // expected-note {{jump bypasses initialization of @catch block}}
   L8: ;
   }
-  
-  
 }
 
 void test2(int a) {
@@ -62,3 +60,18 @@
   blargh: ;
   } @catch (...) {}
 }
+
+ at interface Greeter
++ (void) hello;
+ at end
+
+ at implementation Greeter
++ (void) hello {
+
+  @try {
+    goto blargh;     // expected-error {{illegal goto into protected scope}}
+  } @catch (...) {   // expected-note {{jump bypasses initialization of @catch block}}
+  blargh: ;
+  }
+}
+ at end





More information about the cfe-commits mailing list