]> granicus.if.org Git - clang/commitdiff
test that vlas are checked in an objc method context.
authorChris Lattner <sabre@nondot.org>
Sun, 19 Apr 2009 05:20:37 +0000 (05:20 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 19 Apr 2009 05:20:37 +0000 (05:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69508 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaObjC/scope-check.m

index 6659562bab034c2efa11be13687628de1944cde5..7da4e429a68abab3a12a4b1d938df37b02d3640a 100644 (file)
@@ -74,4 +74,20 @@ void test3() {
   blargh: ;
   }
 }
+
++ (void)meth2 {
+    int n; void *P;
+    goto L0;     // expected-error {{illegal goto into protected scope}}
+    typedef int A[n];  // expected-note {{jump bypasses initialization of VLA typedef}}
+  L0:
+    
+    goto L1;      // expected-error {{illegal goto into protected scope}}
+    A b, c[10];        // expected-note 2 {{jump bypasses initialization of variable length array}}
+  L1:
+    goto L2;     // expected-error {{illegal goto into protected scope}}
+    A d[n];      // expected-note {{jump bypasses initialization of variable length array}}
+  L2:
+    return;
+}
+
 @end