Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/dc5.C

raw
1 // { dg-do run { target c++11 } }
2 // { dg-skip-if "requires hosted libstdc++ for cassert" { ! hostedlib } }
3
4 #include <cassert>
5
6 int count = 0;
7 struct VB
8 {
9 VB() {++count;}
10 };
11
12 struct B : virtual VB
13 {
14 B() : B(42) {}
15 B(int) {}
16 };
17
18 struct D : B
19 {
20 D() {}
21 D(int) : D() {}
22 };
23
24 int main()
25 {
26 D d{42};
27 assert(count == 1);
28 }