From: Chris Lattner Date: Sun, 19 Apr 2009 05:20:37 +0000 (+0000) Subject: test that vlas are checked in an objc method context. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4f9c06ae362c10af797957b92a46fe91d5874899;p=clang test that vlas are checked in an objc method context. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69508 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/SemaObjC/scope-check.m b/test/SemaObjC/scope-check.m index 6659562bab..7da4e429a6 100644 --- a/test/SemaObjC/scope-check.m +++ b/test/SemaObjC/scope-check.m @@ -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