OSDN Git Service

PR c++/26714
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / cpp0x / implicit2.C
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 {
10   A() {}
11   A(const A&) throw () { }
12   template <class T>
13   A(T& t) { r = 0; }
14 };
15
16 struct B
17 {
18   B() {}
19   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
29 int main()
30 {
31   (C(c));
32   return r;
33 }