summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/implicit2.C
blob: f24a78838faf773fce3bdc9ff6aba0e1f73f5370 (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
33
// Test that the synthesized C copy constructor calls the A template
// constructor and has the appropriate exception specification.
// { dg-options -std=c++0x }
// { dg-do run }

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;
}