2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.bugs / 900210_05.C
bloba14c554bb7d295c44b93a99f222ea96c8ed04ece
1 // { dg-do assemble  }
2 // g++ 1.36.1 bug 900210_05
4 // Section 18.3 of the 2.0 Reference Manual says "An implementation
5 // providing { anachronistic features } should also provide a way for
6 // the user to ensure that they do not occur in a source file."
8 // The *only* proper way to "ensure" an absence of anachronstic features
9 // is for C++ language processors to generate errors (rather than just
10 // warnings) when such features are used. These errors could perhaps be
11 // triggered by some set of command line options, or by the absence of
12 // certain command line options.  (For g++, the -pedantic and -traditional
13 // options come to mind.)
15 // The use of errors rather than warnings is important because errors
16 // usually result in nonzero exit status codes for language processors
17 // and these nonzero exit stati can be automatically checked during
18 // normal execution of a Makefile.
20 // cfront 2.0 provides the +p option which causes errors to be generated for
21 // all cases of anachronistic usage.
23 // g++ generates neither errors nor warnings for such usage, even when the
24 // -ansi and -pedantic options are used.
26 // Cfront 2.0 passes this test.
28 // keywords: anachronism, enum types, integral types, implicit type conversions
30 enum enum0 { enum_value_0 } enum0_object;
31 int int0_object;
33 void function ()
35   enum0_object = int0_object;   /* { dg-error "" } */
38 int main () { return 0; }