summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/g++.dg/cpp0x/dc5.C
blob: 59cf2ea1785123f64081dd3154e7c9824fc05f4b (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
// { dg-do run }
// { dg-options "--std=c++11" }

#include <cassert>

int count = 0;
struct VB
{
  VB() {++count;}
};

struct B : virtual VB
{
  B() : B(42) {}
  B(int)  {}
};

struct D : B
{
  D() {}
  D(int) : D() {}
};

int main()
{
  D d{42};
  assert(count == 1);
}
OpenPOWER on IntegriCloud