summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/p4667.C
blob: e8eee21beb96232a20fbdd5c5148a25a6bf8c636 (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
32
// { dg-do run  }
// prms-id: 4667

int counter = 0;
int a = 0;
int b = 0;
int c = 0;

struct A {
  A() { a = counter++; }
};

struct B {
  B() { b = counter++; }
};

struct C : public virtual B {
  C() { c = counter++; }
};

struct D : public virtual A, public virtual C { };

extern "C" int printf(const char*,...);
int main(void) {
  D d;

  if (!(a == 0 && b == 1 && c == 2)) {
    return 1;
  }

  return 0;
}