diff options
Diffstat (limited to 'clang/test/SemaCXX')
-rw-r--r-- | clang/test/SemaCXX/MicrosoftCompatibility.cpp | 10 | ||||
-rw-r--r-- | clang/test/SemaCXX/cxx98-compat.cpp | 8 | ||||
-rw-r--r-- | clang/test/SemaCXX/exceptions.cpp | 24 | ||||
-rw-r--r-- | clang/test/SemaCXX/goto.cpp | 4 | ||||
-rw-r--r-- | clang/test/SemaCXX/scope-check.cpp | 38 | ||||
-rw-r--r-- | clang/test/SemaCXX/statements.cpp | 2 |
6 files changed, 43 insertions, 43 deletions
diff --git a/clang/test/SemaCXX/MicrosoftCompatibility.cpp b/clang/test/SemaCXX/MicrosoftCompatibility.cpp index fb7d9751d1a..56486b8f049 100644 --- a/clang/test/SemaCXX/MicrosoftCompatibility.cpp +++ b/clang/test/SemaCXX/MicrosoftCompatibility.cpp @@ -34,7 +34,7 @@ namespace ms_protected_scope { 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 @@ struct Y { }; 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 @@ void jump_over_var_with_dtor() { 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 @@ void exception_jump() { 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 4fad458f8ff..f4c15c4f746 100644 --- a/clang/test/SemaCXX/cxx98-compat.cpp +++ b/clang/test/SemaCXX/cxx98-compat.cpp @@ -286,18 +286,18 @@ template<typename T> void EnumNNSFn() { 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 c2ca9f952b2..9646a9c3b31 100644 --- a/clang/test/SemaCXX/exceptions.cpp +++ b/clang/test/SemaCXX/exceptions.cpp @@ -35,37 +35,37 @@ void throws() { 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 042ec3cd803..2d37ea9099a 100644 --- a/clang/test/SemaCXX/goto.cpp +++ b/clang/test/SemaCXX/goto.cpp @@ -109,7 +109,7 @@ namespace PR10620 { ~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 PR10620 { 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 dc15dc8b3e6..ac700999c28 100644 --- a/clang/test/SemaCXX/scope-check.cpp +++ b/clang/test/SemaCXX/scope-check.cpp @@ -32,7 +32,7 @@ namespace test1 { 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 @@ namespace test4 { 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 @@ namespace test5 { 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 @@ namespace test8 { 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 PR10462 { 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 @@ namespace test11 { 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 @@ namespace test12 { 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 @@ namespace test13 { 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 @@ namespace test14 { // 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 @@ x: return s.n; 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 @@ namespace test18 { 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 @@ namespace test19 { 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 @@ namespace test20 { 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 @@ namespace test_recovery { 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 @@ namespace test_recovery { 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 6d04c84a675..953a4a89458 100644 --- a/clang/test/SemaCXX/statements.cpp +++ b/clang/test/SemaCXX/statements.cpp @@ -10,7 +10,7 @@ struct X { }; 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: ; |