summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/stmt.stmt/stmt.dcl/p3.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CXX/stmt.stmt/stmt.dcl/p3.cpp')
-rw-r--r--clang/test/CXX/stmt.stmt/stmt.dcl/p3.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/clang/test/CXX/stmt.stmt/stmt.dcl/p3.cpp b/clang/test/CXX/stmt.stmt/stmt.dcl/p3.cpp
index 4bcc648e84a..03c835b21a6 100644
--- a/clang/test/CXX/stmt.stmt/stmt.dcl/p3.cpp
+++ b/clang/test/CXX/stmt.stmt/stmt.dcl/p3.cpp
@@ -1,4 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
// PR10034
struct X {};
@@ -40,8 +42,16 @@ struct Z {
};
void test_Z() {
- goto end; // expected-error{{cannot jump from this goto statement to its label}}
- Z z; // expected-note{{jump bypasses initialization of non-POD variable}}
+ goto end;
+#if __cplusplus <= 199711L
+ // expected-error@-2 {{cannot jump from this goto statement to its label}}
+#endif
+
+ Z z;
+#if __cplusplus <= 199711L
+ // expected-note@-2 {{jump bypasses initialization of non-POD variable}}
+#endif
+
end:
return;
}
OpenPOWER on IntegriCloud