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:
@@ -60,11 +60,22 @@ struct A
|
|||||||
A();
|
A();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if TEST_STD_VER >= 11
|
||||||
|
struct DThrows
|
||||||
|
{
|
||||||
|
DThrows() noexcept(true) {}
|
||||||
|
~DThrows() noexcept(false) {}
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
test_has_not_nothrow_default_constructor<void>();
|
test_has_not_nothrow_default_constructor<void>();
|
||||||
test_has_not_nothrow_default_constructor<int&>();
|
test_has_not_nothrow_default_constructor<int&>();
|
||||||
test_has_not_nothrow_default_constructor<A>();
|
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<Union>();
|
||||||
test_is_nothrow_default_constructible<Empty>();
|
test_is_nothrow_default_constructible<Empty>();
|
||||||
|
|||||||
Reference in New Issue
Block a user