Index: test/std/utilities/tuple/tuple.tuple/tuple.apply/apply.pass.cpp =================================================================== --- test/std/utilities/tuple/tuple.tuple/tuple.apply/apply.pass.cpp +++ test/std/utilities/tuple/tuple.tuple/tuple.apply/apply.pass.cpp @@ -166,7 +166,6 @@ void test_call_quals_and_arg_types() { - TrackedCallable obj; using Tup = std::tuple; const int x = 42; unsigned y = 101; @@ -199,7 +198,7 @@ // test that the functions noexcept-ness is propagated using Tup = std::tuple; Tup t; - ASSERT_NOEXCEPT(std::apply(nec, t)); + LIBCPP_ASSERT_NOEXCEPT(std::apply(nec, t)); ASSERT_NOT_NOEXCEPT(std::apply(tc, t)); } { @@ -207,7 +206,7 @@ using Tup = std::tuple; Tup t; ASSERT_NOT_NOEXCEPT(std::apply(nec, t)); - ASSERT_NOEXCEPT(std::apply(nec, std::move(t))); + LIBCPP_ASSERT_NOEXCEPT(std::apply(nec, std::move(t))); } } Index: test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp =================================================================== --- test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp +++ test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp @@ -175,14 +175,14 @@ Tuple tup; ((void)tup); Tuple const& ctup = tup; ((void)ctup); ASSERT_NOT_NOEXCEPT(std::make_from_tuple(ctup)); - LIBCPP_ONLY(ASSERT_NOEXCEPT(std::make_from_tuple(std::move(tup)))); + LIBCPP_ASSERT_NOEXCEPT(std::make_from_tuple(std::move(tup))); } { using Tuple = std::pair; Tuple tup; ((void)tup); Tuple const& ctup = tup; ((void)ctup); ASSERT_NOT_NOEXCEPT(std::make_from_tuple(ctup)); - LIBCPP_ONLY(ASSERT_NOEXCEPT(std::make_from_tuple(std::move(tup)))); + LIBCPP_ASSERT_NOEXCEPT(std::make_from_tuple(std::move(tup))); } { using Tuple = std::tuple; @@ -192,7 +192,7 @@ { using Tuple = std::tuple; Tuple tup; ((void)tup); - LIBCPP_ONLY(ASSERT_NOEXCEPT(std::make_from_tuple(tup))); + LIBCPP_ASSERT_NOEXCEPT(std::make_from_tuple(tup)); } { using Tuple = std::array; @@ -202,7 +202,7 @@ { using Tuple = std::array; Tuple tup; ((void)tup); - LIBCPP_ONLY(ASSERT_NOEXCEPT(std::make_from_tuple(tup))); + LIBCPP_ASSERT_NOEXCEPT(std::make_from_tuple(tup)); } } Index: test/support/test_macros.h =================================================================== --- test/support/test_macros.h +++ 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 struct is_same { enum { value = 0};} ;