diff options
Diffstat (limited to 'clang')
-rw-r--r-- | clang/test/SemaObjC/scope-check.m | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/scope-check.m b/clang/test/SemaObjC/scope-check.m index 6659562bab0..7da4e429a68 100644 --- a/clang/test/SemaObjC/scope-check.m +++ b/clang/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 |