summaryrefslogtreecommitdiff
path: root/test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp')
-rw-r--r--test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp b/test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp
index c4ac1f1a47bb..0c6362d96863 100644
--- a/test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp
+++ b/test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp
@@ -16,6 +16,7 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "test_allocator.h"
template <class T>
@@ -26,6 +27,11 @@ struct some_alloc
~some_alloc() noexcept(false);
};
+// Test that it's possible to take the address of basic_string's destructors
+// by creating globals which will register their destructors with cxa_atexit.
+std::string s;
+std::wstring ws;
+
int main()
{
{
@@ -38,6 +44,6 @@ int main()
}
{
typedef std::basic_string<char, std::char_traits<char>, some_alloc<char>> C;
- static_assert(!std::is_nothrow_destructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, "");
}
}