diff options
Diffstat (limited to 'test/SemaCXX/scope-check.cpp')
-rw-r--r-- | test/SemaCXX/scope-check.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/test/SemaCXX/scope-check.cpp b/test/SemaCXX/scope-check.cpp index dc15dc8..ac70099 100644 --- a/test/SemaCXX/scope-check.cpp +++ b/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; } } |