URL
https://opencores.org/ocsvn/scarts/scarts/trunk
Details |
Compare with Previous |
View Log
Line No. |
Rev |
Author |
Line |
1 |
12 |
jlechner |
// { dg-do assemble }
|
2 |
|
|
// g++ 1.36.1 bug 900210_05
|
3 |
|
|
|
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."
|
7 |
|
|
|
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.)
|
14 |
|
|
|
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.
|
19 |
|
|
|
20 |
|
|
// cfront 2.0 provides the +p option which causes errors to be generated for
|
21 |
|
|
// all cases of anachronistic usage.
|
22 |
|
|
|
23 |
|
|
// g++ generates neither errors nor warnings for such usage, even when the
|
24 |
|
|
// -ansi and -pedantic options are used.
|
25 |
|
|
|
26 |
|
|
// Cfront 2.0 passes this test.
|
27 |
|
|
|
28 |
|
|
// keywords: anachronism, enum types, integral types, implicit type conversions
|
29 |
|
|
|
30 |
|
|
enum enum0 { enum_value_0 } enum0_object;
|
31 |
|
|
int int0_object;
|
32 |
|
|
|
33 |
|
|
void function ()
|
34 |
|
|
{
|
35 |
|
|
enum0_object = int0_object; /* { dg-error "" } */
|
36 |
|
|
}
|
37 |
|
|
|
38 |
|
|
int main () { return 0; }
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.