1 // { dg-do compile { target c++11 } } 2 3 struct B { 4 int i; BB5 B (int _i) : i(_i) { } ~BB6 ~B () { i = 0; } 7 }; 8 9 struct A : public B { AA10 A () : B(-1) { } AA11 A (int i) : A() { } AA12 A (double b) : A(static_cast<int>(b)) { } AA13 A (double b, double b2) : A(b2) { } ~AA14 ~A () { } 15 }; 16 f_A()17void f_A () { A a(2.0, 3.0); } 18 19 struct C { CC20 C () { } ~CC21 virtual ~C() { } 22 virtual int f () = 0; 23 }; 24 25 struct D : public C { 26 int i; DD27 D (int _i) : C(), i(_i) { } DD28 D () : D(-1) { } ~DD29 virtual ~D() { } fD30 virtual int f () { return 0; } 31 }; 32 f_D()33void f_D () { C* c = new D(); } 34 35 template <typename T> 36 struct E { 37 T t; EE38 E () : E(T()) { } EE39 E (T _t) : t(_t) { } 40 }; 41 f_E()42void f_E () { E<int> e; } 43