summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/cxx0x-defaulted-functions.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-05-06 05:04:56 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-05-06 05:04:56 +0000
commit2b45b267dab44442dbe68708be54e7d85e1b04dd (patch)
treef746cc2cafa1fe7af20fbd93f3aa0f17cee1cd90 /clang/test/SemaCXX/cxx0x-defaulted-functions.cpp
parent7d02ca48789e7963c9239a1d2f7e9c833b0aa3b1 (diff)
downloadbcm5719-llvm-2b45b267dab44442dbe68708be54e7d85e1b04dd.tar.gz
bcm5719-llvm-2b45b267dab44442dbe68708be54e7d85e1b04dd.zip
P1286R2: Remove restriction that the exception specification of a
defaulted special member matches the implicit exception specification. llvm-svn: 360011
Diffstat (limited to 'clang/test/SemaCXX/cxx0x-defaulted-functions.cpp')
-rw-r--r--clang/test/SemaCXX/cxx0x-defaulted-functions.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/clang/test/SemaCXX/cxx0x-defaulted-functions.cpp b/clang/test/SemaCXX/cxx0x-defaulted-functions.cpp
index 6346e1c2353..45a65440d59 100644
--- a/clang/test/SemaCXX/cxx0x-defaulted-functions.cpp
+++ b/clang/test/SemaCXX/cxx0x-defaulted-functions.cpp
@@ -189,11 +189,11 @@ namespace PR15597 {
~A() noexcept(true) = default;
};
template<typename T> 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<int> a;
- B<int> b; // expected-note {{here}}
+ B<int> b;
}
namespace PR27941 {
@@ -242,3 +242,20 @@ template <typename Type>
E<Type>::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()), "");
+}
OpenPOWER on IntegriCloud