FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.bugs / 900210_05.C
blobc053c2a7506a3fa1911e575878244b85aff01d48
1 // g++ 1.36.1 bug 900210_05
3 // Section 18.3 of the 2.0 Reference Manual says "An implementation
4 // providing { anachronistic features } should also provide a way for
5 // the user to ensure that they do not occur in a source file."
7 // The *only* proper way to "ensure" an absence of anachronstic features
8 // is for C++ language processors to generate errors (rather than just
9 // warnings) when such features are used. These errors could perhaps be
10 // triggered by some set of command line options, or by the absence of
11 // certain command line options.  (For g++, the -pedantic and -traditional
12 // options come to mind.)
14 // The use of errors rather than warnings is important because errors
15 // usually result in nonzero exit status codes for language processors
16 // and these nonzero exit stati can be automatically checked during
17 // normal execution of a Makefile.
19 // cfront 2.0 provides the +p option which causes errors to be generated for
20 // all cases of anachronistic usage.
22 // g++ generates neither errors nor warnings for such usage, even when the
23 // -ansi and -pedantic options are used.
25 // Cfront 2.0 passes this test.
27 // keywords: anachronism, enum types, integral types, implicit type conversions
29 enum enum0 { enum_value_0 } enum0_object;
30 int int0_object;
32 void function ()
34   enum0_object = int0_object;   /* ERROR - */
37 int main () { return 0; }