diff options
| author | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2016-12-09 19:53:08 +0000 |
|---|---|---|
| committer | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2016-12-09 19:53:08 +0000 |
| commit | 8a597d653a9548424cc634909e18ec91b3ef6645 (patch) | |
| tree | 2d5b242a58aad8d9b38f795f4a1778879a61cce4 /libcxx/test/support | |
| parent | 23ae31cca0f681c9c948b53e557c53da2004f7dd (diff) | |
| download | bcm5719-llvm-8a597d653a9548424cc634909e18ec91b3ef6645.tar.gz bcm5719-llvm-8a597d653a9548424cc634909e18ec91b3ef6645.zip | |
[libcxx] [test] Add LIBCPP_ASSERT_NOEXCEPT/LIBCPP_ASSERT_NOT_NOEXCEPT, remove an unused variable.
test/support/test_macros.h
For convenience/greppability, add macros for libcxx-specific static_asserts about noexceptness.
(Moving the definitions of ASSERT_NOEXCEPT/ASSERT_NOT_NOEXCEPT isn't technically necessary
because they're macros, but I think it's better style to define stuff before using it.)
test/std/utilities/tuple/tuple.tuple/tuple.apply/apply.pass.cpp
There was a completely unused `TrackedCallable obj;`.
apply() isn't depicted with conditional noexcept in C++17.
test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp
Now that we have LIBCPP_ASSERT_NOEXCEPT, use it.
Fixes D27622.
llvm-svn: 289264
Diffstat (limited to 'libcxx/test/support')
| -rw-r--r-- | libcxx/test/support/test_macros.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h index 4751803e8b6..32d49be8bff 100644 --- a/libcxx/test/support/test_macros.h +++ b/libcxx/test/support/test_macros.h @@ -128,23 +128,27 @@ #define TEST_NORETURN [[noreturn]] #endif +#define ASSERT_NOEXCEPT(...) \ + static_assert(noexcept(__VA_ARGS__), "Operation must be noexcept") + +#define ASSERT_NOT_NOEXCEPT(...) \ + static_assert(!noexcept(__VA_ARGS__), "Operation must NOT be noexcept") + /* Macros for testing libc++ specific behavior and extensions */ #if defined(_LIBCPP_VERSION) #define LIBCPP_ASSERT(...) assert(__VA_ARGS__) #define LIBCPP_STATIC_ASSERT(...) static_assert(__VA_ARGS__) +#define LIBCPP_ASSERT_NOEXCEPT(...) ASSERT_NOEXCEPT(__VA_ARGS__) +#define LIBCPP_ASSERT_NOT_NOEXCEPT(...) ASSERT_NOT_NOEXCEPT(__VA_ARGS__) #define LIBCPP_ONLY(...) __VA_ARGS__ #else #define LIBCPP_ASSERT(...) ((void)0) #define LIBCPP_STATIC_ASSERT(...) ((void)0) +#define LIBCPP_ASSERT_NOEXCEPT(...) ((void)0) +#define LIBCPP_ASSERT_NOT_NOEXCEPT(...) ((void)0) #define LIBCPP_ONLY(...) ((void)0) #endif -#define ASSERT_NOEXCEPT(...) \ - static_assert(noexcept(__VA_ARGS__), "Operation must be noexcept") - -#define ASSERT_NOT_NOEXCEPT(...) \ - static_assert(!noexcept(__VA_ARGS__), "Operation must NOT be noexcept") - namespace test_macros_detail { template <class T, class U> struct is_same { enum { value = 0};} ; |

