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 @@ -49,6 +49,7 @@ #include <__utility/move.h> #include <__utility/swap.h> #include <__utility/transaction.h> +#include <__verbose_abort> #include // for std::abort #include @@ -67,8 +68,7 @@ # ifndef _LIBCPP_NO_EXCEPTIONS throw bad_expected_access<_Err>(std::forward<_Arg>(__arg)); # else - (void)__arg; - std::abort(); + std::__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 @@ -15,6 +15,7 @@ #include <__filesystem/path.h> #include <__memory/shared_ptr.h> #include <__utility/forward.h> +#include <__verbose_abort> #include #include #include @@ -92,7 +93,7 @@ } #else void __throw_filesystem_error(_Args&&...) { - _VSTD::abort(); + std::__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 @@ -28,6 +28,7 @@ #include <__utility/move.h> #include <__utility/piecewise_construct.h> #include <__utility/swap.h> +#include <__verbose_abort> #include #include #include @@ -71,7 +72,7 @@ #ifndef _LIBCPP_NO_EXCEPTIONS throw bad_function_call(); #else - _VSTD::abort(); + std::__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 @@ -32,6 +32,7 @@ #include <__utility/forward.h> #include <__utility/move.h> #include <__utility/swap.h> +#include <__verbose_abort> #include #include // abort #include @@ -121,7 +122,7 @@ #ifndef _LIBCPP_NO_EXCEPTIONS throw bad_weak_ptr(); #else - _VSTD::abort(); + std::__libcpp_verbose_abort("bad_weak_ptr was thrown in -fno-exceptions mode"); #endif } diff --git a/libcxx/include/any b/libcxx/include/any --- a/libcxx/include/any +++ b/libcxx/include/any @@ -91,6 +91,7 @@ #include <__utility/in_place.h> #include <__utility/move.h> #include <__utility/unreachable.h> +#include <__verbose_abort> #include #include #include @@ -120,7 +121,7 @@ #ifndef _LIBCPP_NO_EXCEPTIONS throw bad_any_cast(); #else - _VSTD::abort(); + std::__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 @@ -373,6 +373,7 @@ #include <__utility/auto_cast.h> #include <__utility/forward.h> #include <__utility/move.h> +#include <__verbose_abort> #include #include #include @@ -528,8 +529,8 @@ #ifndef _LIBCPP_NO_EXCEPTIONS throw future_error(make_error_code(__ev)); #else - ((void)__ev); - _VSTD::abort(); + std::__libcpp_verbose_abort( + "future_error was thrown in -fno-excpetions mode with error code %s", make_error_code(__ev)); #endif } diff --git a/libcxx/include/ios b/libcxx/include/ios --- a/libcxx/include/ios +++ b/libcxx/include/ios @@ -220,6 +220,7 @@ #include <__ios/fpos.h> #include <__locale> #include <__utility/swap.h> +#include <__verbose_abort> #include #include @@ -451,8 +452,7 @@ #ifndef _LIBCPP_NO_EXCEPTIONS throw ios_base::failure(__msg); #else - ((void)__msg); - _VSTD::abort(); + std::__verbose_abort("ios_base::failue 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 @@ -92,6 +92,7 @@ #include <__type_traits/is_function.h> #include <__type_traits/is_same.h> #include <__type_traits/remove_cv.h> +#include <__verbose_abort> #include #include #include @@ -176,7 +177,7 @@ #ifndef _LIBCPP_NO_EXCEPTIONS throw bad_array_new_length(); #else - _VSTD::abort(); + std::__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 @@ -171,6 +171,7 @@ #include <__utility/in_place.h> #include <__utility/move.h> #include <__utility/swap.h> +#include <__verbose_abort> #include #include #include @@ -211,7 +212,7 @@ #ifndef _LIBCPP_NO_EXCEPTIONS throw bad_optional_access(); #else - _VSTD::abort(); + std::__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 @@ -773,6 +773,7 @@ #include <__utility/move.h> #include <__utility/pair.h> #include <__utility/swap.h> +#include <__verbose_abort> #include #include #include @@ -1015,7 +1016,7 @@ #ifndef _LIBCPP_NO_EXCEPTIONS throw regex_error(_Ev); #else - _VSTD::abort(); + std::__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 @@ -43,6 +43,7 @@ #include <__assert> // all public C++ headers provide the assertion handler #include <__config> +#include <__verbose_abort> #include #include #include // for string forward decl @@ -223,8 +224,7 @@ #ifndef _LIBCPP_NO_EXCEPTIONS throw logic_error(__msg); #else - ((void)__msg); - _VSTD::abort(); + std::__libcpp_verbose_abort("logic_error was thrown in -fno-exceptions mode with message \"%s\"", __msg); #endif } @@ -234,8 +234,7 @@ #ifndef _LIBCPP_NO_EXCEPTIONS throw domain_error(__msg); #else - ((void)__msg); - _VSTD::abort(); + std::__libcpp_verbose_abort("domain_error was thrown in -fno-exceptions mode with message \"%s\"", __msg); #endif } @@ -245,8 +244,7 @@ #ifndef _LIBCPP_NO_EXCEPTIONS throw invalid_argument(__msg); #else - ((void)__msg); - _VSTD::abort(); + std::__libcpp_verbose_abort("invalid_argument was thrown in -fno-exceptions mode with message \"%s\"", __msg); #endif } @@ -256,8 +254,7 @@ #ifndef _LIBCPP_NO_EXCEPTIONS throw length_error(__msg); #else - ((void)__msg); - _VSTD::abort(); + std::__libcpp_verbose_abort("length_error was thrown in -fno-exceptions mode with message \"%s\"", __msg); #endif } @@ -267,8 +264,7 @@ #ifndef _LIBCPP_NO_EXCEPTIONS throw out_of_range(__msg); #else - ((void)__msg); - _VSTD::abort(); + std::__libcpp_verbose_abort("out_of_range was thrown in -fno-exceptions mode with message \"%s\"", __msg); #endif } @@ -278,8 +274,7 @@ #ifndef _LIBCPP_NO_EXCEPTIONS throw range_error(__msg); #else - ((void)__msg); - _VSTD::abort(); + std::__libcpp_verbose_abort("range_error was thrown in -fno-exceptions mode with message \"%s\"", __msg); #endif } @@ -289,8 +284,7 @@ #ifndef _LIBCPP_NO_EXCEPTIONS throw overflow_error(__msg); #else - ((void)__msg); - _VSTD::abort(); + std::__libcpp_verbose_abort("overflow_error was thrown in -fno-exceptions mode with message \"%s\"", __msg); #endif } @@ -300,8 +294,7 @@ #ifndef _LIBCPP_NO_EXCEPTIONS throw underflow_error(__msg); #else - ((void)__msg); - _VSTD::abort(); + std::__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 @@ -59,6 +59,7 @@ #include <__assert> // all public C++ headers provide the assertion handler #include <__availability> #include <__config> +#include <__verbose_abort> #include #include #include @@ -398,7 +399,7 @@ #ifndef _LIBCPP_NO_EXCEPTIONS throw bad_cast(); #else - _VSTD::abort(); + std::__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 @@ -236,6 +236,7 @@ #include <__utility/move.h> #include <__utility/swap.h> #include <__variant/monostate.h> +#include <__verbose_abort> #include #include #include @@ -288,7 +289,7 @@ #ifndef _LIBCPP_NO_EXCEPTIONS throw bad_variant_access(); #else - _VSTD::abort(); + std::__libcpp_verbose_abort("bad_variant_access was thrown in -fno-exceptions mode"); #endif }