[libcxx] r344220 - Add a test that shows what happens with throwing destructors. NFC.

Marshall Clow mclow.lists at gmail.com
Wed Oct 10 21:07:21 PDT 2018


Author: marshall
Date: Wed Oct 10 21:07:20 2018
New Revision: 344220

URL: http://llvm.org/viewvc/llvm-project?rev=344220&view=rev
Log:
Add a test that shows what happens with throwing destructors. NFC.


Modified:
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_default_constructible.pass.cpp

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_default_constructible.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_default_constructible.pass.cpp?rev=344220&r1=344219&r2=344220&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_default_constructible.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_default_constructible.pass.cpp Wed Oct 10 21:07:20 2018
@@ -60,11 +60,22 @@ struct A
     A();
 };
 
+#if TEST_STD_VER >= 11
+struct DThrows
+{
+    DThrows()  noexcept(true) {}
+    ~DThrows() noexcept(false) {}
+};
+#endif
+
 int main()
 {
     test_has_not_nothrow_default_constructor<void>();
     test_has_not_nothrow_default_constructor<int&>();
     test_has_not_nothrow_default_constructor<A>();
+#if TEST_STD_VER >= 11
+    test_has_not_nothrow_default_constructor<DThrows>(); // This is LWG2116
+#endif
 
     test_is_nothrow_default_constructible<Union>();
     test_is_nothrow_default_constructible<Empty>();




More information about the libcxx-commits mailing list