summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/cxx0x-defaulted-functions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/cxx0x-defaulted-functions.cpp')
-rw-r--r--test/SemaCXX/cxx0x-defaulted-functions.cpp23
1 files changed, 20 insertions, 3 deletions
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<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()), "");
+}