summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2012-04-13 01:08:17 +0000
committerJohn McCall <rjmccall@apple.com>2012-04-13 01:08:17 +0000
commit97b57a2170c2138fb71d336d77c6db7728938108 (patch)
tree0de78e132b2ac12549766cb55c1161c54fc55931 /test/SemaCXX
parent9d4e87e52c1424bad660f7621fb0cf6d6aaad666 (diff)
When we're flagging a protected scope to prevent jumps into the
shadow of a block expression with non-trivial destructed cleanups, we should flag that in the enclosing function, not in the block that we're about to pop. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154646 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX')
-rw-r--r--test/SemaCXX/goto.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/SemaCXX/goto.cpp b/test/SemaCXX/goto.cpp
index e55e880723..24bcb7c516 100644
--- a/test/SemaCXX/goto.cpp
+++ b/test/SemaCXX/goto.cpp
@@ -115,3 +115,13 @@ namespace PR10620 {
;
}
}
+
+namespace test12 {
+ struct A { A(); A(const A&); ~A(); };
+ void test(A a) { // expected-note {{jump enters lifetime of block}} FIXME: wierd location
+ goto lbl; // expected-error {{goto into protected scope}}
+ (void) ^{ (void) a; };
+ lbl:
+ return;
+ }
+}