FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.bugs / 900107_01.C
blob7271f1aa71ee5344fd8b42591a8bd16600954d91
1 // g++ 1.36.1 bug 900107_01
3 // Unlike GCC and Cfront 2.0, the g++ 1.36.1 compiler gives struct, union,
4 // and class declarations which are nested within blocks file scope.
6 // Cfront 2.0 passes this test.
8 // keywords: block scope, file scope, nested types, tagged types
10 class c1 { int c1_member1; };
11 struct s1 { int s1_member1; };
12 union u1 { int u1_member1; };
13 enum e1 { e1_val1 };
14 typedef int t1;
16 void foo ()
18   class c1 {                    // gets bogus error
19     int c1_member1;
20   } c1_local_object_0;
22   struct s1 {                   // gets bogus error
23     int s1_member1;
24   } s1_local_object_0;
26   union u1 {                    // gets bogus error
27     int u1_member1;
28   } u1_local_object_0;
30   enum e1 {             // OK using g++ or GCC, but mishandled by Cfront 2.0.
31     e1_value1
32   } e1_local_object_0;
34   typedef int t1;               // OK
37 int main () { return 0; }