diff options
author | John McCall <rjmccall@apple.com> | 2010-10-28 08:53:48 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-10-28 08:53:48 +0000 |
commit | 95c225de9fa3d79f70ef5008c0279580a7d9dcad (patch) | |
tree | fd16d2e2abb0c26b1944dd5b666f9aa08404db14 /test/SemaCXX/scope-check.cpp | |
parent | 3c7d7afd2530610e3d5678c4369731471d1bfb59 (diff) |
Implement an indirect-goto optimization for goto *&&lbl and respect this
in the scope checker. With that done, turn an indirect goto into a
protected scope into a hard error; otherwise IR generation has to start
worrying about declarations not dominating their scopes, as exemplified
in PR8473.
If this really affects anyone, I can probably adjust this to only hard-error
on possible indirect gotos into VLA scopes rather than arbitrary scopes.
But we'll see how people cope with the aggressive change on the marginal
feature.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117539 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/scope-check.cpp')
-rw-r--r-- | test/SemaCXX/scope-check.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/SemaCXX/scope-check.cpp b/test/SemaCXX/scope-check.cpp index cdc3868a7b..d462af06d7 100644 --- a/test/SemaCXX/scope-check.cpp +++ b/test/SemaCXX/scope-check.cpp @@ -66,7 +66,7 @@ namespace test4 { C c0; - goto *ip; // expected-warning {{indirect goto might cross protected scopes}} + goto *ip; // expected-error {{indirect goto might cross protected scopes}} C c1; // expected-note {{jump bypasses variable initialization}} lbl1: // expected-note {{possible target of indirect goto}} return 0; @@ -90,7 +90,7 @@ namespace test5 { if (ip[1]) { D d; // expected-note {{jump exits scope of variable with non-trivial destructor}} ip += 2; - goto *ip; // expected-warning {{indirect goto might cross protected scopes}} + goto *ip; // expected-error {{indirect goto might cross protected scopes}} } return 1; } |