view gcc/testsuite/g++.dg/cpp0x/implicit2.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

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