aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/goto.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/goto.cpp')
-rw-r--r--test/SemaCXX/goto.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/test/SemaCXX/goto.cpp b/test/SemaCXX/goto.cpp
index 2db9d97fd8..e8b7822c32 100644
--- a/test/SemaCXX/goto.cpp
+++ b/test/SemaCXX/goto.cpp
@@ -1,5 +1,4 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-
// PR9463
double *end;
void f() {
@@ -16,3 +15,32 @@ void f() {
void g() {
end = 1; // expected-error{{assigning to 'double *' from incompatible type 'int'}}
}
+
+void h(int end) {
+ {
+ goto end; // expected-error{{use of undeclared label 'end'}}
+ }
+}
+
+void h2(int end) {
+ {
+ __label__ end;
+ goto end;
+
+ end:
+ ::end = 0;
+ }
+ end:
+ end = 1;
+}
+
+class X {
+public:
+ X();
+};
+
+void rdar9135994()
+{
+X:
+ goto X;
+}