summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/condition.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/condition.cpp')
-rw-r--r--test/SemaCXX/condition.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/SemaCXX/condition.cpp b/test/SemaCXX/condition.cpp
index ec5eb17..d805881 100644
--- a/test/SemaCXX/condition.cpp
+++ b/test/SemaCXX/condition.cpp
@@ -19,7 +19,7 @@ void test() {
while (struct NewS *x=0) ;
while (struct S {} *x=0) ; // expected-error {{types may not be defined in conditions}}
while (struct {} *x=0) ; // expected-error {{types may not be defined in conditions}}
- switch (enum {E} x=0) ; // expected-error {{types may not be defined in conditions}} expected-error {{cannot initialize}} \
+ switch (enum {E} x=0) ; // expected-error {{types may not be defined in conditions}} \
// expected-warning{{enumeration value 'E' not handled in switch}} expected-warning {{switch statement has empty body}} \
// expected-note{{put the semicolon on a separate line}}
@@ -58,3 +58,12 @@ void test3() {
void test4(bool (&x)(void)) {
while (x);
}
+
+template <class>
+void test5() {
+ if (struct S {}* p = 0) // expected-error {{types may not be defined in conditions}}
+ ;
+}
+void test5_inst() {
+ test5<int>();
+}
OpenPOWER on IntegriCloud