From 1b26ab1b5287ec6c00e8e506657abe438c90a71b Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 6 May 2019 05:04:56 +0000 Subject: P1286R2: Remove restriction that the exception specification of a defaulted special member matches the implicit exception specification. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360011 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/SemaCXX/cxx0x-defaulted-functions.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'test/SemaCXX/cxx0x-defaulted-functions.cpp') diff --git a/test/SemaCXX/cxx0x-defaulted-functions.cpp b/test/SemaCXX/cxx0x-defaulted-functions.cpp index 6346e1c235..45a65440d5 100644 --- a/test/SemaCXX/cxx0x-defaulted-functions.cpp +++ b/test/SemaCXX/cxx0x-defaulted-functions.cpp @@ -189,11 +189,11 @@ namespace PR15597 { ~A() noexcept(true) = default; }; template struct B { - B() noexcept(false) = default; // expected-error {{does not match the calculated one}} - ~B() noexcept(false) = default; // expected-error {{does not match the calculated one}} + B() noexcept(false) = default; + ~B() noexcept(false) = default; }; A a; - B b; // expected-note {{here}} + B b; } namespace PR27941 { @@ -242,3 +242,20 @@ template E::E(const int&) {} // expected-error {{definition of explicitly defaulted function}} } + +namespace P1286R2 { + struct X { + X(); + }; + struct A { + struct B { + B() noexcept(A::value) = default; + X x; + }; + decltype(B()) b; + static constexpr bool value = true; + }; + A::B b; + + static_assert(noexcept(A::B()), ""); +} -- cgit v1.2.3