2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.bugs / 900121_05.C
blob8dbae5df5b64ca39702babf7d66e18d78f5a95f2
1 // { dg-do assemble  }
2 // g++ 1.36.1 bug 900121_05
4 // g++ allows unions to have base types (i.e. to be "derived") and it allows
5 // other types to have unions as base types.  Both cases are illegal.
7 // g++ curently does not detect such errors.
9 // Cfront 2.0 passes this test.
11 // keywords: unions, inheritance
13 struct s0 {
14   int s0_member;
17 union u0 : public s0 {                  /* { dg-error "" } union has base class */
18   int u0_member_0;
19   int u0_member_1;
22 union u1 {
23   int u1_member_0;
24   int u1_member_1;
27 struct s1 : public u1 {                 /* { dg-error "" } base class is a union */
28   int s1_member_0;
31 int main () { return 0; }