aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/vbase1.C
blob: 58d26fcf2add8caeefbbfdc523200a037acb9f38 (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
// Check that template classes handle inherited virtual bases
// properly, initializing them before direct non-virtual bases.

int aflag;

struct A
{
  A() { aflag = 1; }
};

struct B : virtual public A 
{
  B() { }
};

struct C
{
  C() { if (!aflag) exit (1); }
};

template<class Parent>
struct D : public C, public Parent
{
  D() { }
};

int
main ()
{
  D<B> c;
}