3 // Negative testcase for decls in conditions.
9 if (int i = 1) // { dg-message "previously" }
11 char i; // { dg-error "redeclaration" }
16 short i; // { dg-error "redeclaration" }
20 while (int i = 0) // { dg-message "previously" }
22 int i; // { dg-error "redeclaration" }
25 for (; int i = 0; ) // { dg-message "previously" }
27 int i; // { dg-error "redeclaration" }
30 switch (int i = 0) // { dg-message "previously" }
33 int i; // { dg-error "redeclaration" }
36 if (struct A { operator int () { return 1; } } *foo = new A) // { dg-error "defined" }
39 A bar; // { dg-error "not declared" "decl" }
41 if (enum A { one, two, three } foo = one) // { dg-error "defined" "def" }
42 // { dg-error "not declared" "expected" { target *-*-* } .-1 }
45 struct B { operator int () { return 2; } };
47 if (struct B * foo = new B)
50 if (int f () = 1) // { dg-error "declares a function" }
53 if (int a[2] = {1, 2}) // { dg-error "declares an array" }