diff --git a/test/support/count_new.hpp b/test/support/count_new.hpp index 580e67505..923e49513 100644 --- a/test/support/count_new.hpp +++ b/test/support/count_new.hpp @@ -16,14 +16,13 @@ #include "test_macros.h" -#if TEST_HAS_FEATURE(address_sanitizer) \ - || TEST_HAS_FEATURE(memory_sanitizer) \ - || TEST_HAS_FEATURE(thread_sanitizer) +#if defined(TEST_HAS_SANITIZERS) #define DISABLE_NEW_COUNT #endif namespace detail { + TEST_NORETURN inline void throw_bad_alloc_helper() { #ifndef TEST_HAS_NO_EXCEPTIONS throw std::bad_alloc(); diff --git a/test/support/test_macros.h b/test/support/test_macros.h index 10b550066..ada4a961a 100644 --- a/test/support/test_macros.h +++ b/test/support/test_macros.h @@ -86,6 +86,12 @@ #define TEST_HAS_SANITIZERS #endif +#if defined(_LIBCPP_NORETURN) +#define TEST_NORETURN _LIBCPP_NORETURN +#else +#define TEST_NORETURN [[noreturn]] +#endif + /* Macros for testing libc++ specific behavior and extensions */ #if defined(_LIBCPP_VERSION) #define LIBCPP_ASSERT(...) assert(__VA_ARGS__)