aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/implicit2.C
blob: 2995894424f17a4e31d80804e77ce535406fa627 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Test that the synthesized C copy constructor calls the A template
// constructor and has the appropriate exception specification.
// { dg-do run { target c++11 } }

int r = 1;

struct A
{
  A() {}
  A(const A&) throw () { }
  template <class T>
  A(T& t) { r = 0; }
};

struct B
{
  B() {}
  B(B&) throw () { }
};

struct C: A, B { };

#define SA(E) static_assert(E, #E)

C c;
SA (!noexcept(C(c)));

int main()
{
  (C(c));
  return r;
}