aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.old-deja/g++.bugs/900121_05.C
blob: 62db5b343afed32430aaae18e27b75861ab894ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// { dg-do assemble  }
// g++ 1.36.1 bug 900121_05

// g++ allows unions to have base types (i.e. to be "derived") and it allows
// other types to have unions as base types.  Both cases are illegal.

// g++ curently does not detect such errors.

// Cfront 2.0 passes this test.

// keywords: unions, inheritance

struct s0 {
  int s0_member;
};

union u0 : public s0 {			/* { dg-error "" } union has base class */
  int u0_member_0;
  int u0_member_1;
};

union u1 {
  int u1_member_0;
  int u1_member_1;
};

struct s1 : public u1 {			/* { dg-error "base type" } */
  int s1_member_0;
};

int main () { return 0; }