Reword switch/goto diagnostics "protected scope" diagnostics. Making up a term
"protected scope" is very unhelpful here and actively confuses users. Instead,
simply state the nature of the problem in the diagnostic: we cannot jump from
here to there. The notes explain nicely why not.
llvm-svn: 217293
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 78f3eeb..7098cc8 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -4110,25 +4110,28 @@
def warn_unused_label : Warning<"unused label %0">,
InGroup<UnusedLabel>, DefaultIgnore;
-def err_goto_into_protected_scope : Error<"goto into protected scope">;
-def ext_goto_into_protected_scope : ExtWarn<"goto into protected scope">,
+def err_goto_into_protected_scope : Error<
+ "cannot jump from this goto statement to its label">;
+def ext_goto_into_protected_scope : ExtWarn<
+ "jump from this goto statement to its label is a Microsoft extension">,
InGroup<Microsoft>;
def warn_cxx98_compat_goto_into_protected_scope : Warning<
- "goto would jump into protected scope in C++98">,
+ "jump from this goto statement to its label is incompatible with C++98">,
InGroup<CXX98Compat>, DefaultIgnore;
def err_switch_into_protected_scope : Error<
- "switch case is in protected scope">;
+ "cannot jump from switch statement to this case label">;
def warn_cxx98_compat_switch_into_protected_scope : Warning<
- "switch case would be in a protected scope in C++98">,
+ "jump from switch statement to this case label is incompatible with C++98">,
InGroup<CXX98Compat>, DefaultIgnore;
def err_indirect_goto_without_addrlabel : Error<
"indirect goto in function with no address-of-label expressions">;
def err_indirect_goto_in_protected_scope : Error<
- "indirect goto might cross protected scopes">;
+ "cannot jump from this indirect goto statement to one of its possible targets">;
def warn_cxx98_compat_indirect_goto_in_protected_scope : Warning<
- "indirect goto might cross protected scopes in C++98">,
- InGroup<CXX98Compat>, DefaultIgnore;
-def note_indirect_goto_target : Note<"possible target of indirect goto">;
+ "jump from this indirect goto statement to one of its possible targets "
+ "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
+def note_indirect_goto_target : Note<
+ "possible target of indirect goto statement">;
def note_protected_by_variable_init : Note<
"jump bypasses variable initialization">;
def note_protected_by_variable_nontriv_destructor : Note<
diff --git a/clang/test/ARCMT/checking.m b/clang/test/ARCMT/checking.m
index 7815103..d8ccf16 100644
--- a/clang/test/ARCMT/checking.m
+++ b/clang/test/ARCMT/checking.m
@@ -182,7 +182,7 @@
;
id x; // expected-note {{jump bypasses initialization of retaining variable}}
- case 1: // expected-error {{switch case is in protected scope}}
+ case 1: // expected-error {{cannot jump}}
x = 0;
break;
}
diff --git a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p2-0x.cpp b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p2-0x.cpp
index cc44f74..865abb0 100644
--- a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p2-0x.cpp
+++ b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p2-0x.cpp
@@ -44,7 +44,7 @@
void f() {
int n = 42;
- goto foo; // expected-error {{goto into protected scope}}
+ goto foo; // expected-error {{cannot jump}}
using T = int[n]; // expected-note {{bypasses initialization of VLA type alias}}
foo: ;
}
diff --git a/clang/test/CXX/drs/dr0xx.cpp b/clang/test/CXX/drs/dr0xx.cpp
index 144b51d..6f4be9e 100644
--- a/clang/test/CXX/drs/dr0xx.cpp
+++ b/clang/test/CXX/drs/dr0xx.cpp
@@ -1051,18 +1051,18 @@
void test(int n) {
switch (n) {
try { // expected-note 2{{bypasses}}
- case 0: // expected-error {{protected}}
+ case 0: // expected-error {{cannot jump}}
x:
throw n;
} catch (...) { // expected-note 2{{bypasses}}
- case 1: // expected-error {{protected}}
+ case 1: // expected-error {{cannot jump}}
y:
throw n;
}
case 2:
- goto x; // expected-error {{protected}}
+ goto x; // expected-error {{cannot jump}}
case 3:
- goto y; // expected-error {{protected}}
+ goto y; // expected-error {{cannot jump}}
}
}
}
diff --git a/clang/test/CXX/drs/dr2xx.cpp b/clang/test/CXX/drs/dr2xx.cpp
index bb9af9f..78078b9 100644
--- a/clang/test/CXX/drs/dr2xx.cpp
+++ b/clang/test/CXX/drs/dr2xx.cpp
@@ -499,7 +499,7 @@
throw 0;
X: ;
} catch (int) {
- goto X; // expected-error {{protected scope}}
+ goto X; // expected-error {{cannot jump}}
}
};
}
diff --git a/clang/test/CXX/drs/dr4xx.cpp b/clang/test/CXX/drs/dr4xx.cpp
index bbb9ee4..a38949d 100644
--- a/clang/test/CXX/drs/dr4xx.cpp
+++ b/clang/test/CXX/drs/dr4xx.cpp
@@ -755,7 +755,7 @@
return k;
}
int g() {
- goto later; // expected-error {{protected scope}}
+ goto later; // expected-error {{cannot jump}}
int k = stuff(); // expected-note {{bypasses variable initialization}}
later:
return k;
diff --git a/clang/test/CXX/drs/dr5xx.cpp b/clang/test/CXX/drs/dr5xx.cpp
index 73f1a26..8af639f 100644
--- a/clang/test/CXX/drs/dr5xx.cpp
+++ b/clang/test/CXX/drs/dr5xx.cpp
@@ -692,7 +692,7 @@
void jump() {
goto x;
#if __cplusplus < 201103L
- // expected-error@-2 {{protected scope}}
+ // expected-error@-2 {{cannot jump}}
// expected-note@+2 {{non-POD}}
#endif
trivial t;
diff --git a/clang/test/CXX/stmt.stmt/stmt.dcl/p3-0x.cpp b/clang/test/CXX/stmt.stmt/stmt.dcl/p3-0x.cpp
index 574cb40..d7726c9 100644
--- a/clang/test/CXX/stmt.stmt/stmt.dcl/p3-0x.cpp
+++ b/clang/test/CXX/stmt.stmt/stmt.dcl/p3-0x.cpp
@@ -30,11 +30,11 @@
void f();
void test_Y() {
- goto end; // expected-error{{goto into protected scope}}
+ goto end; // expected-error{{cannot jump from this goto statement to its label}}
Y y; // expected-note{{jump bypasses variable with a non-trivial destructor}}
end:
f();
- goto inner; // expected-error{{goto into protected scope}}
+ goto inner; // expected-error{{cannot jump from this goto statement to its label}}
{
Y y2; // expected-note{{jump bypasses variable with a non-trivial destructor}}
inner:
diff --git a/clang/test/CXX/stmt.stmt/stmt.dcl/p3.cpp b/clang/test/CXX/stmt.stmt/stmt.dcl/p3.cpp
index f52e3b6..4bcc648 100644
--- a/clang/test/CXX/stmt.stmt/stmt.dcl/p3.cpp
+++ b/clang/test/CXX/stmt.stmt/stmt.dcl/p3.cpp
@@ -29,7 +29,7 @@
};
void test_Y() {
- goto end; // expected-error{{goto into protected scope}}
+ goto end; // expected-error{{cannot jump from this goto statement to its label}}
Y y; // expected-note{{jump bypasses variable with a non-trivial destructor}}
end:
return;
@@ -40,7 +40,7 @@
};
void test_Z() {
- goto end; // expected-error{{goto into protected scope}}
+ goto end; // expected-error{{cannot jump from this goto statement to its label}}
Z z; // expected-note{{jump bypasses initialization of non-POD variable}}
end:
return;
diff --git a/clang/test/Sema/block-misc.c b/clang/test/Sema/block-misc.c
index b4732b5..0ca4f20 100644
--- a/clang/test/Sema/block-misc.c
+++ b/clang/test/Sema/block-misc.c
@@ -190,7 +190,7 @@
// rdar://7072507
int test19() {
- goto L0; // expected-error {{goto into protected scope}}
+ goto L0; // expected-error {{cannot jump}}
__block int x; // expected-note {{jump bypasses setup of __block variable}}
L0:
diff --git a/clang/test/Sema/scope-check.c b/clang/test/Sema/scope-check.c
index a9494d3..fa37d10 100644
--- a/clang/test/Sema/scope-check.c
+++ b/clang/test/Sema/scope-check.c
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify -fblocks -std=gnu99 %s -Wno-unreachable-code
int test1(int x) {
- goto L; // expected-error{{goto into protected scope}}
+ goto L; // expected-error{{cannot jump from this goto statement to its label}}
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:
@@ -9,7 +9,7 @@
}
int test2(int x) {
- goto L; // expected-error{{goto into protected scope}}
+ goto L; // expected-error{{cannot jump from this goto statement to its label}}
typedef int a[x]; // expected-note {{jump bypasses initialization of VLA typedef}}
L:
return sizeof(a);
@@ -18,14 +18,14 @@
void test3clean(int*);
int test3() {
- goto L; // expected-error{{goto into protected scope}}
+ goto L; // expected-error{{cannot jump from this goto statement to its label}}
int a __attribute((cleanup(test3clean))); // expected-note {{jump bypasses initialization of variable with __attribute__((cleanup))}}
L:
return a;
}
int test4(int x) {
- goto L; // expected-error{{goto into protected scope}}
+ goto L; // expected-error{{cannot jump from this goto statement to its label}}
int a[x]; // expected-note {{jump bypasses initialization of variable length array}}
test4(x);
L:
@@ -50,7 +50,7 @@
switch (x) {
case 1: ;
int a[x]; // expected-note {{jump bypasses initialization of variable length array}}
- case 2: // expected-error {{switch case is in protected scope}}
+ case 2: // expected-error {{cannot jump from switch statement to this case label}}
a[1] = 2;
break;
}
@@ -58,17 +58,17 @@
int test8(int x) {
// For statement.
- goto L2; // expected-error {{goto into protected scope}}
+ goto L2; // expected-error {{cannot jump from this goto statement to its label}}
for (int arr[x]; // expected-note {{jump bypasses initialization of variable length array}}
; ++x)
L2:;
// Statement expressions.
- goto L3; // expected-error {{goto into protected scope}}
+ goto L3; // expected-error {{cannot jump from this goto statement to its label}}
int Y = ({ int a[x]; // expected-note {{jump bypasses initialization of variable length array}}
L3: 4; });
- goto L4; // expected-error {{goto into protected scope}}
+ goto L4; // expected-error {{cannot jump from this goto statement to its label}}
{
int A[x], // expected-note {{jump bypasses initialization of variable length array}}
B[x]; // expected-note {{jump bypasses initialization of variable length array}}
@@ -91,7 +91,7 @@
int A[x], B = ({ if (x)
goto L7;
else
- goto L8; // expected-error {{goto into protected scope}}
+ goto L8; // expected-error {{cannot jump from this goto statement to its label}}
4; }),
C[x]; // expected-note {{jump bypasses initialization of variable length array}}
L8:; // bad
@@ -103,7 +103,7 @@
goto L9;
else
// FIXME:
- goto L10; // fixme-error {{goto into protected scope}}
+ goto L10; // fixme-error {{cannot jump from this goto statement to its label}}
4; })];
L10:; // bad
}
@@ -123,7 +123,7 @@
}
// Statement expressions 2.
- goto L1; // expected-error {{goto into protected scope}}
+ goto L1; // expected-error {{cannot jump from this goto statement to its label}}
return x == ({
int a[x]; // expected-note {{jump bypasses initialization of variable length array}}
L1:
@@ -133,7 +133,7 @@
void test9(int n, void *P) {
int Y;
int Z = 4;
- goto *P; // expected-error {{indirect goto might cross protected scopes}}
+ goto *P; // expected-error {{cannot jump from this indirect goto statement to one of its possible targets}}
L2: ;
int a[n]; // expected-note {{jump bypasses initialization of variable length array}}
@@ -151,14 +151,14 @@
}
void test10(int n, void *P) {
- goto L0; // expected-error {{goto into protected scope}}
+ goto L0; // expected-error {{cannot jump from this goto statement to its label}}
typedef int A[n]; // expected-note {{jump bypasses initialization of VLA typedef}}
L0:
- goto L1; // expected-error {{goto into protected scope}}
+ goto L1; // expected-error {{cannot jump from this goto statement to its label}}
A b, c[10]; // expected-note 2 {{jump bypasses initialization of variable length array}}
L1:
- goto L2; // expected-error {{goto into protected scope}}
+ goto L2; // expected-error {{cannot jump from this goto statement to its label}}
A d[n]; // expected-note {{jump bypasses initialization of variable length array}}
L2:
return;
@@ -171,7 +171,7 @@
case 2:
case 3:;
int Arr[n]; // expected-note {{jump bypasses initialization of variable length array}}
- case 4: // expected-error {{switch case is in protected scope}}
+ case 4: // expected-error {{cannot jump from switch statement to this case label}}
return;
}
};
@@ -185,7 +185,7 @@
L1:
goto L2;
L2:
- goto L3; // expected-error {{goto into protected scope}}
+ goto L3; // expected-error {{cannot jump from this goto statement to its label}}
int Arr[n]; // expected-note {{jump bypasses initialization of variable length array}}
L3:
goto L4;
@@ -220,7 +220,7 @@
void test15(int n, void *pc) {
static const void *addrs[] = { &&L1, &&L2 };
- goto *pc; // expected-error {{indirect goto might cross protected scope}}
+ goto *pc; // expected-error {{cannot jump from this indirect goto statement to one of its possible targets}}
L1:
{
diff --git a/clang/test/SemaCXX/MicrosoftCompatibility.cpp b/clang/test/SemaCXX/MicrosoftCompatibility.cpp
index fb7d975..56486b8 100644
--- a/clang/test/SemaCXX/MicrosoftCompatibility.cpp
+++ b/clang/test/SemaCXX/MicrosoftCompatibility.cpp
@@ -34,7 +34,7 @@
int jump_over_variable_init(bool b) {
if (b)
- goto foo; // expected-warning {{goto into protected scope}}
+ goto foo; // expected-warning {{jump from this goto statement to its label is a Microsoft extension}}
C c; // expected-note {{jump bypasses variable initialization}}
foo:
return 1;
@@ -45,7 +45,7 @@
};
void jump_over_var_with_dtor() {
- goto end; // expected-warning{{goto into protected scope}}
+ goto end; // expected-warning{{jump from this goto statement to its label is a Microsoft extension}}
Y y; // expected-note {{jump bypasses variable with a non-trivial destructor}}
end:
;
@@ -55,14 +55,14 @@
switch (c) {
case 0:
int x = 56; // expected-note {{jump bypasses variable initialization}}
- case 1: // expected-error {{switch case is in protected scope}}
+ case 1: // expected-error {{cannot jump}}
x = 10;
}
}
void exception_jump() {
- goto l2; // expected-error {{goto into protected scope}}
+ goto l2; // expected-error {{cannot jump}}
try { // expected-note {{jump bypasses initialization of try block}}
l2: ;
} catch(int) {
@@ -71,7 +71,7 @@
int jump_over_indirect_goto() {
static void *ps[] = { &&a0 };
- goto *&&a0; // expected-warning {{goto into protected scope}}
+ goto *&&a0; // expected-warning {{jump from this goto statement to its label is a Microsoft extension}}
int a = 3; // expected-note {{jump bypasses variable initialization}}
a0:
return 0;
diff --git a/clang/test/SemaCXX/cxx98-compat.cpp b/clang/test/SemaCXX/cxx98-compat.cpp
index 4fad458..f4c15c4 100644
--- a/clang/test/SemaCXX/cxx98-compat.cpp
+++ b/clang/test/SemaCXX/cxx98-compat.cpp
@@ -286,18 +286,18 @@
template void EnumNNSFn<Enum>(); // expected-note {{in instantiation}}
void JumpDiagnostics(int n) {
- goto DirectJump; // expected-warning {{goto would jump into protected scope in C++98}}
+ goto DirectJump; // expected-warning {{jump from this goto statement to its label is incompatible with C++98}}
TrivialButNonPOD tnp1; // expected-note {{jump bypasses initialization of non-POD variable}}
DirectJump:
void *Table[] = {&&DirectJump, &&Later};
- goto *Table[n]; // expected-warning {{indirect goto might cross protected scopes in C++98}}
+ goto *Table[n]; // expected-warning {{jump from this indirect goto statement to one of its possible targets is incompatible with C++98}}
TrivialButNonPOD tnp2; // expected-note {{jump bypasses initialization of non-POD variable}}
-Later: // expected-note {{possible target of indirect goto}}
+Later: // expected-note {{possible target of indirect goto statement}}
switch (n) {
TrivialButNonPOD tnp3; // expected-note {{jump bypasses initialization of non-POD variable}}
- default: // expected-warning {{switch case would be in a protected scope in C++98}}
+ default: // expected-warning {{jump from switch statement to this case label is incompatible with C++98}}
return;
}
}
diff --git a/clang/test/SemaCXX/exceptions.cpp b/clang/test/SemaCXX/exceptions.cpp
index c2ca9f9..9646a9c 100644
--- a/clang/test/SemaCXX/exceptions.cpp
+++ b/clang/test/SemaCXX/exceptions.cpp
@@ -35,37 +35,37 @@
void jumps() {
l1:
goto l5;
- goto l4; // expected-error {{goto into protected scope}}
- goto l3; // expected-error {{goto into protected scope}}
- goto l2; // expected-error {{goto into protected scope}}
+ goto l4; // expected-error {{cannot jump}}
+ goto l3; // expected-error {{cannot jump}}
+ goto l2; // expected-error {{cannot jump}}
goto l1;
try { // expected-note 4 {{jump bypasses initialization of try block}}
l2:
goto l5;
- goto l4; // expected-error {{goto into protected scope}}
- goto l3; // expected-error {{goto into protected scope}}
+ goto l4; // expected-error {{cannot jump}}
+ goto l3; // expected-error {{cannot jump}}
goto l2;
goto l1;
} catch(int) { // expected-note 4 {{jump bypasses initialization of catch block}}
l3:
goto l5;
- goto l4; // expected-error {{goto into protected scope}}
+ goto l4; // expected-error {{cannot jump}}
goto l3;
- goto l2; // expected-error {{goto into protected scope}}
+ goto l2; // expected-error {{cannot jump}}
goto l1;
} catch(...) { // expected-note 4 {{jump bypasses initialization of catch block}}
l4:
goto l5;
goto l4;
- goto l3; // expected-error {{goto into protected scope}}
- goto l2; // expected-error {{goto into protected scope}}
+ goto l3; // expected-error {{cannot jump}}
+ goto l2; // expected-error {{cannot jump}}
goto l1;
}
l5:
goto l5;
- goto l4; // expected-error {{goto into protected scope}}
- goto l3; // expected-error {{goto into protected scope}}
- goto l2; // expected-error {{goto into protected scope}}
+ goto l4; // expected-error {{cannot jump}}
+ goto l3; // expected-error {{cannot jump}}
+ goto l2; // expected-error {{cannot jump}}
goto l1;
}
diff --git a/clang/test/SemaCXX/goto.cpp b/clang/test/SemaCXX/goto.cpp
index 042ec3c..2d37ea9 100644
--- a/clang/test/SemaCXX/goto.cpp
+++ b/clang/test/SemaCXX/goto.cpp
@@ -109,7 +109,7 @@
~S() {}
};
void g(const S& s) {
- goto done; // expected-error {{goto into protected scope}}
+ goto done; // expected-error {{cannot jump}}
const S s2(s); // expected-note {{jump bypasses variable initialization}}
done:
;
@@ -119,7 +119,7 @@
namespace test12 {
struct A { A(); A(const A&); ~A(); };
void test(A a) { // expected-note {{jump enters lifetime of block}} FIXME: weird location
- goto lbl; // expected-error {{goto into protected scope}}
+ goto lbl; // expected-error {{cannot jump}}
(void) ^{ (void) a; };
lbl:
return;
diff --git a/clang/test/SemaCXX/scope-check.cpp b/clang/test/SemaCXX/scope-check.cpp
index dc15dc8..ac70099 100644
--- a/clang/test/SemaCXX/scope-check.cpp
+++ b/clang/test/SemaCXX/scope-check.cpp
@@ -32,7 +32,7 @@
int f(bool b) {
if (b)
- goto foo; // expected-error {{goto into protected scope}}
+ goto foo; // expected-error {{cannot jump}}
C c; // expected-note {{jump bypasses variable initialization}}
foo:
return 1;
@@ -79,7 +79,7 @@
C c0;
- goto *ip; // expected-error {{indirect goto might cross protected scopes}}
+ goto *ip; // expected-error {{cannot jump}}
C c1; // expected-note {{jump bypasses variable initialization}}
lbl1: // expected-note {{possible target of indirect goto}}
return 0;
@@ -103,7 +103,7 @@
if (ip[1]) {
D d; // expected-note {{jump exits scope of variable with non-trivial destructor}}
ip += 2;
- goto *ip; // expected-error {{indirect goto might cross protected scopes}}
+ goto *ip; // expected-error {{cannot jump}}
}
return 1;
}
@@ -153,13 +153,13 @@
switch (c) {
case 0:
int x = 56; // expected-note {{jump bypasses variable initialization}}
- case 1: // expected-error {{switch case is in protected scope}}
+ case 1: // expected-error {{cannot jump}}
x = 10;
}
}
void test2() {
- goto l2; // expected-error {{goto into protected scope}}
+ goto l2; // expected-error {{cannot jump}}
l1: int x = 5; // expected-note {{jump bypasses variable initialization}}
l2: x++;
}
@@ -208,7 +208,7 @@
namespace test10 {
int test() {
static void *ps[] = { &&a0 };
- goto *&&a0; // expected-error {{goto into protected scope}}
+ goto *&&a0; // expected-error {{cannot jump}}
int a = 3; // expected-note {{jump bypasses variable initialization}}
a0:
return 0;
@@ -225,7 +225,7 @@
static void *ips[] = { &&l0 };
l0: // expected-note {{possible target of indirect goto}}
C c0 = 42; // expected-note {{jump exits scope of variable with non-trivial destructor}}
- goto *ip; // expected-error {{indirect goto might cross protected scopes}}
+ goto *ip; // expected-error {{cannot jump}}
}
}
@@ -240,7 +240,7 @@
l0: // expected-note {{possible target of indirect goto}}
const C &c1 = 42; // expected-note {{jump exits scope of lifetime-extended temporary with non-trivial destructor}}
const C &c2 = c0;
- goto *ip; // expected-error {{indirect goto might cross protected scopes}}
+ goto *ip; // expected-error {{cannot jump}}
}
}
@@ -254,7 +254,7 @@
static void *ips[] = { &&l0 };
l0: // expected-note {{possible target of indirect goto}}
const int &c1 = C(1).i; // expected-note {{jump exits scope of lifetime-extended temporary with non-trivial destructor}}
- goto *ip; // expected-error {{indirect goto might cross protected scopes}}
+ goto *ip; // expected-error {{cannot jump}}
}
}
@@ -276,21 +276,21 @@
// PR14225
namespace test15 {
void f1() try {
- goto x; // expected-error {{goto into protected scope}}
+ goto x; // expected-error {{cannot jump}}
} catch(...) { // expected-note {{jump bypasses initialization of catch block}}
x: ;
}
void f2() try { // expected-note {{jump bypasses initialization of try block}}
x: ;
} catch(...) {
- goto x; // expected-error {{goto into protected scope}}
+ goto x; // expected-error {{cannot jump}}
}
}
namespace test16 {
struct S { int n; };
int f() {
- goto x; // expected-error {{goto into protected scope}}
+ goto x; // expected-error {{cannot jump}}
const S &s = S(); // expected-note {{jump bypasses variable initialization}}
x: return s.n;
}
@@ -300,7 +300,7 @@
namespace test17 {
struct S { int get(); private: int n; };
int f() {
- goto x; // expected-error {{goto into protected scope}}
+ goto x; // expected-error {{cannot jump}}
S s = {}; // expected-note {{jump bypasses variable initialization}}
x: return s.get();
}
@@ -321,7 +321,7 @@
void *p = &&x;
x: // expected-note {{possible target of indirect goto}}
B b = { 0, A() }; // expected-note {{jump exits scope of lifetime-extended temporary with non-trivial destructor}}
- goto *p; // expected-error {{indirect goto might cross protected scopes}}
+ goto *p; // expected-error {{cannot jump}}
}
}
@@ -342,7 +342,7 @@
A a;
x: // expected-note {{possible target of indirect goto}}
std::initializer_list<A> il = { a }; // expected-note {{jump exits scope of lifetime-extended temporary with non-trivial destructor}}
- goto *p; // expected-error {{indirect goto might cross protected scopes}}
+ goto *p; // expected-error {{cannot jump}}
}
}
@@ -370,14 +370,14 @@
a,
{ A() } // expected-note {{jump exits scope of lifetime-extended temporary with non-trivial destructor}}
};
- goto *p; // expected-error {{indirect goto might cross protected scopes}}
+ goto *p; // expected-error {{cannot jump}}
}
}
#endif
namespace test21 {
template<typename T> void f() {
- goto x; // expected-error {{protected scope}}
+ goto x; // expected-error {{cannot jump}}
T t; // expected-note {{bypasses}}
x: return;
}
@@ -428,7 +428,7 @@
void test(nexist, int c) { // expected-error {{}}
nexist_fn(); // expected-error {{}}
goto nexist_label; // expected-error {{use of undeclared label}}
- goto a0; // expected-error {{goto into protected scope}}
+ goto a0; // expected-error {{cannot jump}}
int a = 0; // expected-note {{jump bypasses variable initialization}}
a0:;
@@ -436,7 +436,7 @@
case $: // expected-error {{}}
case 0:
int x = 56; // expected-note {{jump bypasses variable initialization}}
- case 1: // expected-error {{switch case is in protected scope}}
+ case 1: // expected-error {{cannot jump}}
x = 10;
}
}
diff --git a/clang/test/SemaCXX/statements.cpp b/clang/test/SemaCXX/statements.cpp
index 6d04c84..953a4a8 100644
--- a/clang/test/SemaCXX/statements.cpp
+++ b/clang/test/SemaCXX/statements.cpp
@@ -10,7 +10,7 @@
};
void test2() {
- goto later; // expected-error {{goto into protected scope}}
+ goto later; // expected-error {{cannot jump}}
X x; // expected-note {{jump bypasses variable initialization}}
later:
;
diff --git a/clang/test/SemaObjC/arc-jump-block.m b/clang/test/SemaObjC/arc-jump-block.m
index 9b06c5a..418d296 100644
--- a/clang/test/SemaObjC/arc-jump-block.m
+++ b/clang/test/SemaObjC/arc-jump-block.m
@@ -21,15 +21,15 @@
case 0:
dispatch_async((&_dispatch_main_q), ^{ [self pageLeft]; }); // expected-note 3 {{jump enters lifetime of block which strongly captures a variable}}
break;
- case 2: // expected-error {{switch case is in protected scope}}
+ case 2: // expected-error {{cannot jump}}
dispatch_async((&_dispatch_main_q), ^{ [self pageRight]; }); // expected-note 2 {{jump enters lifetime of block which strongly captures a variable}}
break;
- case 3: // expected-error {{switch case is in protected scope}}
+ case 3: // expected-error {{cannot jump}}
{
dispatch_async((&_dispatch_main_q), ^{ [self pageRight]; });
break;
}
- case 4: // expected-error {{switch case is in protected scope}}
+ case 4: // expected-error {{cannot jump}}
break;
}
@@ -90,7 +90,7 @@
(void) ^{ (void) obj; };
return 0;
- default: // expected-error {{switch case is in protected scope}}
+ default: // expected-error {{cannot jump}}
return 1;
}
}
diff --git a/clang/test/SemaObjC/arc.m b/clang/test/SemaObjC/arc.m
index 285c737..2816cef7 100644
--- a/clang/test/SemaObjC/arc.m
+++ b/clang/test/SemaObjC/arc.m
@@ -135,7 +135,7 @@
;
id x; // expected-note {{jump bypasses initialization of retaining variable}}
- case 1: // expected-error {{switch case is in protected scope}}
+ case 1: // expected-error {{cannot jump}}
break;
}
}
diff --git a/clang/test/SemaObjC/autoreleasepool.m b/clang/test/SemaObjC/autoreleasepool.m
index 45c749e..c88f1ba 100644
--- a/clang/test/SemaObjC/autoreleasepool.m
+++ b/clang/test/SemaObjC/autoreleasepool.m
@@ -7,7 +7,7 @@
@implementation AUTORP
- (void) unregisterTask:(id) task {
- goto L; // expected-error {{goto into protected scope}}
+ goto L; // expected-error {{cannot jump}}
@autoreleasepool { // expected-note {{jump bypasses auto release push of @autoreleasepool block}}
void *tmp = objc_autoreleasepool_push();
diff --git a/clang/test/SemaObjC/scope-check.m b/clang/test/SemaObjC/scope-check.m
index e19ba47..b52e7a0 100644
--- a/clang/test/SemaObjC/scope-check.m
+++ b/clang/test/SemaObjC/scope-check.m
@@ -3,9 +3,9 @@
@class A, B, C;
void test1() {
- goto L; // expected-error{{goto into protected scope}}
- goto L2; // expected-error{{goto into protected scope}}
- goto L3; // expected-error{{goto into protected scope}}
+ goto L; // expected-error{{cannot jump}}
+ goto L2; // expected-error{{cannot jump}}
+ goto L3; // expected-error{{cannot jump}}
@try { // expected-note {{jump bypasses initialization of @try block}}
L: ;
} @catch (A *x) { // expected-note {{jump bypasses initialization of @catch block}}
@@ -17,11 +17,11 @@
}
@try {
- goto L4; // expected-error{{goto into protected scope}}
- goto L5; // expected-error{{goto into protected scope}}
+ goto L4; // expected-error{{cannot jump}}
+ goto L5; // expected-error{{cannot jump}}
} @catch (C *c) { // expected-note {{jump bypasses initialization of @catch block}}
L5: ;
- goto L6; // expected-error{{goto into protected scope}}
+ goto L6; // expected-error{{cannot jump}}
} @catch (B *c) { // expected-note {{jump bypasses initialization of @catch block}}
L6: ;
} @finally { // expected-note {{jump bypasses initialization of @finally block}}
@@ -32,12 +32,12 @@
@try { // expected-note 2 {{jump bypasses initialization of @try block}}
L7: ;
} @catch (C *c) {
- goto L7; // expected-error{{goto into protected scope}}
+ goto L7; // expected-error{{cannot jump}}
} @finally {
- goto L7; // expected-error{{goto into protected scope}}
+ goto L7; // expected-error{{cannot jump}}
}
- goto L8; // expected-error{{goto into protected scope}}
+ goto L8; // expected-error{{cannot jump}}
@try {
} @catch (A *c) {
} @catch (B *c) {
@@ -47,7 +47,7 @@
// rdar://6810106
id X;
- goto L9; // expected-error{{goto into protected scope}}
+ goto L9; // expected-error{{cannot jump}}
goto L10; // ok
@synchronized // expected-note {{jump bypasses initialization of @synchronized block}}
( ({ L10: ; X; })) {
@@ -79,7 +79,7 @@
+ (void) hello {
@try {
- goto blargh; // expected-error {{goto into protected scope}}
+ goto blargh; // expected-error {{cannot jump}}
} @catch (...) { // expected-note {{jump bypasses initialization of @catch block}}
blargh: ;
}
@@ -87,14 +87,14 @@
+ (void)meth2 {
int n; void *P;
- goto L0; // expected-error {{goto into protected scope}}
+ goto L0; // expected-error {{cannot jump}}
typedef int A[n]; // expected-note {{jump bypasses initialization of VLA typedef}}
L0:
- goto L1; // expected-error {{goto into protected scope}}
+ goto L1; // expected-error {{cannot jump}}
A b, c[10]; // expected-note 2 {{jump bypasses initialization of variable length array}}
L1:
- goto L2; // expected-error {{goto into protected scope}}
+ goto L2; // expected-error {{cannot jump}}
A d[n]; // expected-note {{jump bypasses initialization of variable length array}}
L2:
return;