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