def err_goto_into_protected_scope : Error<"illegal goto into protected scope">;
def note_protected_by_vla_typedef : Note<
- "scope created by VLA typedef">;
+ "jump bypasses initialization of VLA typedef">;
def note_protected_by_vla : Note<
- "scope created by variable length array">;
+ "jump bypasses initialization of variable length array">;
def note_protected_by_cleanup : Note<
- "scope created by declaration with __attribute__((cleanup))">;
+ "jump bypasses initialization of declaration with __attribute__((cleanup))">;
def note_protected_by_objc_try : Note<
- "scope created by @try block">;
+ "jump bypasses initialization of @try block">;
def err_func_returning_array_function : Error<
"function cannot return array or function type %0">;
// RUN: clang-cc -fsyntax-only -verify %s
-/*
-"/tmp/bug.c", line 2: error: transfer of control bypasses initialization of:
- variable length array "a" (declared at line 3)
- variable length array "b" (declared at line 3)
- goto L;
- ^
-"/tmp/bug.c", line 3: warning: variable "b" was declared but never referenced
- int a[x], b[x];
- ^
-*/
-
int test1(int x) {
goto L; // expected-error{{illegal goto into protected scope}}
- int a[x]; // expected-note {{scope created by variable length array}}
- int b[x]; // expected-note {{scope created by variable length array}}
+ int a[x]; // expected-note {{jump bypasses initialization of variable length array}}
+ int b[x]; // expected-note {{jump bypasses initialization of variable length array}}
L:
return sizeof a;
}
int test2(int x) {
goto L; // expected-error{{illegal goto into protected scope}}
- typedef int a[x]; // expected-note {{scope created by VLA typedef}}
+ typedef int a[x]; // expected-note {{jump bypasses initialization of VLA typedef}}
L:
return sizeof(a);
}
int test3() {
goto L; // expected-error{{illegal goto into protected scope}}
-int a __attribute((cleanup(test3clean))); // expected-note {{scope created by declaration with __attribute__((cleanup))}}
+int a __attribute((cleanup(test3clean))); // expected-note {{jump bypasses initialization of declaration with __attribute__((cleanup))}}
L:
return a;
}
int test4(int x) {
goto L; // expected-error{{illegal goto into protected scope}}
-int a[x]; // expected-note {{scope created by variable length array}}
+int a[x]; // expected-note {{jump bypasses initialization of variable length array}}
test4(x);
L:
return sizeof a;
goto L; // expected-error{{illegal goto into protected scope}}
goto L2; // expected-error{{illegal goto into protected scope}}
goto L3; // expected-error{{illegal goto into protected scope}}
- @try { // expected-note 3 {{scope created by @try block}}
+ @try { // expected-note 3 {{jump bypasses initialization of @try block}}
L: ;
} @catch (A *x) {
L2: ;