diff --git a/libcxx/include/__format/format_error.h b/libcxx/include/__format/format_error.h --- a/libcxx/include/__format/format_error.h +++ b/libcxx/include/__format/format_error.h @@ -11,6 +11,7 @@ #define _LIBCPP___FORMAT_FORMAT_ERROR_H #include <__config> +#include <__verbose_abort> #include #include @@ -40,8 +41,7 @@ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS throw format_error(__s); #else - (void)__s; - _VSTD::abort(); + _LIBCPP_VERBOSE_ABORT("format_error was thrown in -fno-exceptions mode: %s", __s); #endif } diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp --- a/libcxx/src/locale.cpp +++ b/libcxx/src/locale.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// #include <__utility/unreachable.h> +#include <__verbose_abort> #include #include #include @@ -115,8 +116,7 @@ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS throw runtime_error(msg); #else - (void)msg; - _VSTD::abort(); + _LIBCPP_VERBOSE_ABORT("runtime_error was thrown in -fno-exceptions mode: %s", msg); #endif } @@ -6532,8 +6532,7 @@ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS throw runtime_error(msg); #else - (void)msg; - _VSTD::abort(); + _LIBCPP_VERBOSE_ABORT("runtime_error was thrown in -fno-exceptions mode: %s", msg); #endif } diff --git a/libcxx/src/string.cpp b/libcxx/src/string.cpp --- a/libcxx/src/string.cpp +++ b/libcxx/src/string.cpp @@ -7,12 +7,12 @@ //===----------------------------------------------------------------------===// #include <__assert> +#include <__verbose_abort> #include #include #include #include #include -#include #include #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS @@ -66,8 +66,7 @@ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS throw T(msg); #else - fprintf(stderr, "%s\n", msg.c_str()); - _VSTD::abort(); + _LIBCPP_VERBOSE_ABORT(msg.c_str()); #endif } diff --git a/libcxx/src/system_error.cpp b/libcxx/src/system_error.cpp --- a/libcxx/src/system_error.cpp +++ b/libcxx/src/system_error.cpp @@ -12,6 +12,7 @@ #endif #include <__assert> +#include <__verbose_abort> #include #include #include @@ -289,9 +290,7 @@ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS throw system_error(error_code(ev, system_category()), what_arg); #else - (void)ev; - (void)what_arg; - _VSTD::abort(); + _LIBCPP_VERBOSE_ABORT("system_error was thrown in -fno-exceptions mode: (%i) %s", ev, what_arg); #endif }