diff --git a/libcxx/include/__expected/expected.h b/libcxx/include/__expected/expected.h --- a/libcxx/include/__expected/expected.h +++ b/libcxx/include/__expected/expected.h @@ -69,7 +69,7 @@ throw bad_expected_access<_Err>(std::forward<_Arg>(__arg)); # else (void)__arg; - std::__libcpp_verbose_abort("bad_expected_access was thrown in -fno-exceptions mode"); + _LIBCPP_VERBOSE_ABORT("bad_expected_access was thrown in -fno-exceptions mode"); # endif } diff --git a/libcxx/include/__filesystem/filesystem_error.h b/libcxx/include/__filesystem/filesystem_error.h --- a/libcxx/include/__filesystem/filesystem_error.h +++ b/libcxx/include/__filesystem/filesystem_error.h @@ -92,7 +92,7 @@ } #else void __throw_filesystem_error(_Args&&...) { - std::__libcpp_verbose_abort("filesystem_error was thrown in -fno-exceptions mode"); + _LIBCPP_VERBOSE_ABORT("filesystem_error was thrown in -fno-exceptions mode"); } #endif _LIBCPP_AVAILABILITY_FILESYSTEM_POP diff --git a/libcxx/include/__functional/function.h b/libcxx/include/__functional/function.h --- a/libcxx/include/__functional/function.h +++ b/libcxx/include/__functional/function.h @@ -74,7 +74,7 @@ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS throw bad_function_call(); #else - std::__libcpp_verbose_abort("bad_function_call was thrown in -fno-exceptions mode"); + _LIBCPP_VERBOSE_ABORT("bad_function_call was thrown in -fno-exceptions mode"); #endif } diff --git a/libcxx/include/__memory/shared_ptr.h b/libcxx/include/__memory/shared_ptr.h --- a/libcxx/include/__memory/shared_ptr.h +++ b/libcxx/include/__memory/shared_ptr.h @@ -137,7 +137,7 @@ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS throw bad_weak_ptr(); #else - std::__libcpp_verbose_abort("bad_weak_ptr was thrown in -fno-exceptions mode"); + _LIBCPP_VERBOSE_ABORT("bad_weak_ptr was thrown in -fno-exceptions mode"); #endif } diff --git a/libcxx/include/__verbose_abort b/libcxx/include/__verbose_abort --- a/libcxx/include/__verbose_abort +++ b/libcxx/include/__verbose_abort @@ -46,7 +46,8 @@ # endif # if defined(_LIBCPP_HAS_NO_VERBOSE_ABORT_IN_LIBRARY) -# define _LIBCPP_VERBOSE_ABORT(...) __builtin_abort() +// The decltype is there to suppress -Wunused warnings in this configuration. +# define _LIBCPP_VERBOSE_ABORT(...) (decltype(std::__libcpp_verbose_abort(__VA_ARGS__))(), __builtin_abort()) # else # define _LIBCPP_VERBOSE_ABORT(...) ::std::__libcpp_verbose_abort(__VA_ARGS__) # endif diff --git a/libcxx/include/any b/libcxx/include/any --- a/libcxx/include/any +++ b/libcxx/include/any @@ -135,7 +135,7 @@ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS throw bad_any_cast(); #else - std::__libcpp_verbose_abort("bad_any_cast was thrown in -fno-exceptions mode"); + _LIBCPP_VERBOSE_ABORT("bad_any_cast was thrown in -fno-exceptions mode"); #endif } diff --git a/libcxx/include/future b/libcxx/include/future --- a/libcxx/include/future +++ b/libcxx/include/future @@ -534,7 +534,7 @@ throw future_error(make_error_code(__ev)); #else (void)__ev; - std::__libcpp_verbose_abort("future_error was thrown in -fno-exceptions mode"); + _LIBCPP_VERBOSE_ABORT("future_error was thrown in -fno-exceptions mode"); #endif } diff --git a/libcxx/include/ios b/libcxx/include/ios --- a/libcxx/include/ios +++ b/libcxx/include/ios @@ -452,7 +452,7 @@ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS throw ios_base::failure(__msg); #else - std::__libcpp_verbose_abort("ios_base::failure was thrown in -fno-exceptions mode with message \"%s\"", __msg); + _LIBCPP_VERBOSE_ABORT("ios_base::failure was thrown in -fno-exceptions mode with message \"%s\"", __msg); #endif } diff --git a/libcxx/include/new b/libcxx/include/new --- a/libcxx/include/new +++ b/libcxx/include/new @@ -177,7 +177,7 @@ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS throw bad_array_new_length(); #else - std::__libcpp_verbose_abort("bad_array_new_length was thrown in -fno-exceptions mode"); + _LIBCPP_VERBOSE_ABORT("bad_array_new_length was thrown in -fno-exceptions mode"); #endif } diff --git a/libcxx/include/optional b/libcxx/include/optional --- a/libcxx/include/optional +++ b/libcxx/include/optional @@ -221,7 +221,7 @@ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS throw bad_optional_access(); #else - std::__libcpp_verbose_abort("bad_optional_access was thrown in -fno-exceptions mode"); + _LIBCPP_VERBOSE_ABORT("bad_optional_access was thrown in -fno-exceptions mode"); #endif } diff --git a/libcxx/include/regex b/libcxx/include/regex --- a/libcxx/include/regex +++ b/libcxx/include/regex @@ -1018,7 +1018,7 @@ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS throw regex_error(_Ev); #else - std::__libcpp_verbose_abort("regex_error was thrown in -fno-exceptions mode"); + _LIBCPP_VERBOSE_ABORT("regex_error was thrown in -fno-exceptions mode"); #endif } diff --git a/libcxx/include/stdexcept b/libcxx/include/stdexcept --- a/libcxx/include/stdexcept +++ b/libcxx/include/stdexcept @@ -224,7 +224,7 @@ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS throw logic_error(__msg); #else - std::__libcpp_verbose_abort("logic_error was thrown in -fno-exceptions mode with message \"%s\"", __msg); + _LIBCPP_VERBOSE_ABORT("logic_error was thrown in -fno-exceptions mode with message \"%s\"", __msg); #endif } @@ -234,7 +234,7 @@ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS throw domain_error(__msg); #else - std::__libcpp_verbose_abort("domain_error was thrown in -fno-exceptions mode with message \"%s\"", __msg); + _LIBCPP_VERBOSE_ABORT("domain_error was thrown in -fno-exceptions mode with message \"%s\"", __msg); #endif } @@ -244,7 +244,7 @@ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS throw invalid_argument(__msg); #else - std::__libcpp_verbose_abort("invalid_argument was thrown in -fno-exceptions mode with message \"%s\"", __msg); + _LIBCPP_VERBOSE_ABORT("invalid_argument was thrown in -fno-exceptions mode with message \"%s\"", __msg); #endif } @@ -254,7 +254,7 @@ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS throw length_error(__msg); #else - std::__libcpp_verbose_abort("length_error was thrown in -fno-exceptions mode with message \"%s\"", __msg); + _LIBCPP_VERBOSE_ABORT("length_error was thrown in -fno-exceptions mode with message \"%s\"", __msg); #endif } @@ -264,7 +264,7 @@ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS throw out_of_range(__msg); #else - std::__libcpp_verbose_abort("out_of_range was thrown in -fno-exceptions mode with message \"%s\"", __msg); + _LIBCPP_VERBOSE_ABORT("out_of_range was thrown in -fno-exceptions mode with message \"%s\"", __msg); #endif } @@ -274,7 +274,7 @@ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS throw range_error(__msg); #else - std::__libcpp_verbose_abort("range_error was thrown in -fno-exceptions mode with message \"%s\"", __msg); + _LIBCPP_VERBOSE_ABORT("range_error was thrown in -fno-exceptions mode with message \"%s\"", __msg); #endif } @@ -284,7 +284,7 @@ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS throw overflow_error(__msg); #else - std::__libcpp_verbose_abort("overflow_error was thrown in -fno-exceptions mode with message \"%s\"", __msg); + _LIBCPP_VERBOSE_ABORT("overflow_error was thrown in -fno-exceptions mode with message \"%s\"", __msg); #endif } @@ -294,7 +294,7 @@ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS throw underflow_error(__msg); #else - std::__libcpp_verbose_abort("underflow_error was thrown in -fno-exceptions mode with message \"%s\"", __msg); + _LIBCPP_VERBOSE_ABORT("underflow_error was thrown in -fno-exceptions mode with message \"%s\"", __msg); #endif } diff --git a/libcxx/include/typeinfo b/libcxx/include/typeinfo --- a/libcxx/include/typeinfo +++ b/libcxx/include/typeinfo @@ -409,7 +409,7 @@ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS throw bad_cast(); #else - std::__libcpp_verbose_abort("bad_cast was thrown in -fno-exceptions mode"); + _LIBCPP_VERBOSE_ABORT("bad_cast was thrown in -fno-exceptions mode"); #endif } _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/variant b/libcxx/include/variant --- a/libcxx/include/variant +++ b/libcxx/include/variant @@ -291,7 +291,7 @@ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS throw bad_variant_access(); #else - std::__libcpp_verbose_abort("bad_variant_access was thrown in -fno-exceptions mode"); + _LIBCPP_VERBOSE_ABORT("bad_variant_access was thrown in -fno-exceptions mode"); #endif }