]> gcc.gnu.org Git - gcc.git/blame - gcc/testsuite/g++.dg/cpp0x/dc1.C
PR c++/92590 - wrong handling of inherited default ctor.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / dc1.C
CommitLineData
4b2e63de 1// { dg-do compile { target c++11 } }
238e471c
VV
2
3struct B {
4 int i;
5 B (int _i) : i(_i) { }
6 ~B () { i = 0; }
7};
8
9struct A : public B {
10 A () : B(-1) { }
11 A (int i) : A() { }
12 A (double b) : A(static_cast<int>(b)) { }
13 A (double b, double b2) : A(b2) { }
14 ~A () { }
15};
16
17void f_A () { A a(2.0, 3.0); }
18
19struct C {
20 C () { }
21 virtual ~C() { }
22 virtual int f () = 0;
23};
24
25struct D : public C {
26 int i;
27 D (int _i) : C(), i(_i) { }
28 D () : D(-1) { }
29 virtual ~D() { }
19520957 30 virtual int f () { return 0; }
238e471c
VV
31};
32
33void f_D () { C* c = new D(); }
34
35template <typename T>
36struct E {
37 T t;
38 E () : E(T()) { }
39 E (T _t) : t(_t) { }
40};
41
42void f_E () { E<int> e; }
This page took 5.660311 seconds and 5 git commands to generate.