Add a test that shows what happens with throwing destructors. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@344220 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2018-10-11 04:07:20 +00:00
parent f9c56dae68
commit e436a759bf

View File

@@ -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>();