2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.bugs / 900107_01.C
blobb486fc664525e093f2475802e6f67c56623dbacb
1 // { dg-do run  }
2 // g++ 1.36.1 bug 900107_01
4 // Unlike GCC and Cfront 2.0, the g++ 1.36.1 compiler gives struct, union,
5 // and class declarations which are nested within blocks file scope.
7 // Cfront 2.0 passes this test.
9 // keywords: block scope, file scope, nested types, tagged types
11 class c1 { int c1_member1; };
12 struct s1 { int s1_member1; };
13 union u1 { int u1_member1; };
14 enum e1 { e1_val1 };
15 typedef int t1;
17 void foo ()
19   class c1 {                    // { dg-bogus "" } 
20     int c1_member1;
21   } c1_local_object_0;
23   struct s1 {                   // { dg-bogus "" } 
24     int s1_member1;
25   } s1_local_object_0;
27   union u1 {                    // { dg-bogus "" } 
28     int u1_member1;
29   } u1_local_object_0;
31   enum e1 {             // OK using g++ or GCC, but mishandled by Cfront 2.0.
32     e1_value1
33   } e1_local_object_0;
35   typedef int t1;               // OK
38 int main () { return 0; }