aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/DRs/dr1778.C
blob: 8db937fc0bf211c7678c370f6952cfaaddf1095b (plain)
1
2
3
4
5
6
7
// P1286R2: Contra CWG1778
// { dg-do compile { target c++11 } }

struct T { T(); T(T &&) noexcept(false); };
struct U { T t; U(); U(U &&) noexcept = default; };
U u1;
U u2 = static_cast<U&&>(u1);      // OK, calls std::terminate if T::T(T&&) throws