1 /* { dg-do compile } */
2 /* { dg-options "-fpermissive" } // suppress default -pedantic-errors */
4 /* This code used to be a legitimate, if dubious, extension. However,
5 it's been broken since GCC 3.0 (caused ICE) and we have now removed
6 the extension. See PR c/7353.
8 For cases A and C, C++ issues a warning in addition to the error,
9 since this construct appears to be a case of implicit int
10 (forbidden in std. C++) until we get to the equals sign. */
12 /* Case A: just the bare name = initializer. */
14 typedef A = 0; /* { dg-error "does not name a type" "A" } */
15 A a; /* { dg-error "does not name a type" "A error cascade" } */
17 /* Case B: with a type also. */
19 typedef int B = 0; /* { dg-error "initialized" "B" } */
20 B b; /* { dg-error "does not name a type" "B error cascade" } */
22 /* C and D are the same as A and B, but wrapped in a structure;
23 field declarations go by a different code path in C++ (ick). */
26 typedef C = 0; /* { dg-error "does not name a type" "C" } */
27 C c; /* { dg-error "" "C error cascade" } */
29 typedef int D = 0; /* { dg-error "initialized" "D" } */
30 D d; /* { dg-bogus "" "D error cascade" } */
33 template<int> void foo()
35 typedef int i = 0; /* { dg-error "is initialized" } */