1 // Test that the synthesized C copy constructor calls the A template 2 // constructor and has the appropriate exception specification. 3 // { dg-options -std=c++0x } 4 // { dg-do run } 5 6 int r = 1; 7 8 struct A 9 { AA10 A() {} throwA11 A(const A&) throw () { } 12 template <class T> AA13 A(T& t) { r = 0; } 14 }; 15 16 struct B 17 { BB18 B() {} throwB19 B(B&) throw () { } 20 }; 21 22 struct C: A, B { }; 23 24 #define SA(E) static_assert(E, #E) 25 26 C c; 27 SA (!noexcept(C(c))); 28 main()29int main() 30 { 31 (C(c)); 32 return r; 33 } 34