diff --git a/libcxx/docs/UsingLibcxx.rst b/libcxx/docs/UsingLibcxx.rst --- a/libcxx/docs/UsingLibcxx.rst +++ b/libcxx/docs/UsingLibcxx.rst @@ -152,18 +152,18 @@ disable them). However, most of the code in libc++ is in the headers, so the user-selected value for ``_LIBCPP_ENABLE_ASSERTIONS`` (if any) will usually be respected. -When an assertion fails, an assertion handler function is called. The library provides a default -assertion handler that prints an error message and calls ``std::abort()``. Note that this assertion +When an assertion fails, the program is aborted through a special verbose abort handler. The library +provides a default handler that prints an error message and calls ``std::abort()``. Note that this handler is provided by the static or shared library, so it is only available when deploying to a platform where the compiled library is sufficiently recent. However, users can also override that -assertion handler with their own, which can be useful to provide custom behavior, or when deploying -to older platforms where the default assertion handler isn't available. +handler with their own, which can be useful to provide custom behavior, or when deploying to older +platforms where the default handler isn't available. -Replacing the default assertion handler is done by defining the following function: +Replacing the default verbose abort handler is done by defining the following function: .. code-block:: cpp - void __libcpp_assertion_handler(char const* format, ...) + void __libcpp_verbose_abort(char const* format, ...) This mechanism is similar to how one can replace the default definition of ``operator new`` and ``operator delete``. For example: @@ -173,7 +173,7 @@ // In HelloWorldHandler.cpp #include // must include any libc++ header before defining the handler (C compatibility headers excluded) - void std::__libcpp_assertion_handler(char const* format, ...) { + void std::__libcpp_verbose_abort(char const* format, ...) { va_list list; va_start(list, format); std::vfprintf(stderr, format, list); @@ -187,31 +187,30 @@ int main() { std::vector v; - int& x = v[0]; // Your assertion handler will be called here if _LIBCPP_ENABLE_ASSERTIONS=1 + int& x = v[0]; // Your handler will be called here if _LIBCPP_ENABLE_ASSERTIONS=1 } -Also note that the assertion handler should usually not return. Since the assertions in libc++ -catch undefined behavior, your code will proceed with undefined behavior if your assertion -handler is called and does return. - -Furthermore, throwing an exception from the assertion handler is not recommended. Indeed, many -functions in the library are ``noexcept``, and any exception thrown from the assertion handler -will result in ``std::terminate`` being called. - -Back-deploying with a custom assertion handler ----------------------------------------------- -When deploying to an older platform that does not provide a default assertion handler, the -compiler will diagnose the usage of ``std::__libcpp_assertion_handler`` with an error. This -is done to avoid the load-time error that would otherwise happen if the code was being deployed -on the older system. - -If you are providing a custom assertion handler, this error is effectively a false positive. -To let the library know that you are providing a custom assertion handler in back-deployment -scenarios, you must define the ``_LIBCPP_AVAILABILITY_CUSTOM_ASSERTION_HANDLER_PROVIDED`` macro, -and the library will assume that you are providing your own definition. If no definition is -provided and the code is back-deployed to the older platform, it will fail to load when the -dynamic linker fails to find a definition for ``std::__libcpp_assertion_handler``, so you -should only remove the guard rails if you really mean it! +Also note that the abort handler should never return. Since the assertions in libc++ catch +undefined behavior, your code will proceed with undefined behavior if your handler is called +and does return. + +Furthermore, exceptions should not be thrown from the handler. Indeed, many functions in the +library are ``noexcept``, and any exception thrown from the handler will result in ``std::terminate`` +being called. + +Back-deploying with a custom verbose abort handler +-------------------------------------------------- +When deploying to an older platform that does not provide a default verbose abort handler, the +compiler will diagnose the usage of ``std::__libcpp_verbose_abort`` with an error. This is done +to avoid the load-time error that would otherwise happen if the code was being deployed on the +older system. + +If you are providing a custom verbose abort handler, this error is effectively a false positive. +To let the library know that you are providing a custom handler in back-deployment scenarios, you +must define the ``_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_HANDLER_PROVIDED`` macro, and the library +will assume that you are providing your own definition. If no definition is provided and the code is +back-deployed to the older platform, it will fail to load when the dynamic linker fails to find a +definition of the handler, so you should only remove the guard rails if you really mean it! Libc++ Configuration Macros =========================== diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt --- a/libcxx/include/CMakeLists.txt +++ b/libcxx/include/CMakeLists.txt @@ -635,6 +635,7 @@ __utility/transaction.h __utility/unreachable.h __variant/monostate.h + __verbose_abort algorithm any array diff --git a/libcxx/include/__assert b/libcxx/include/__assert --- a/libcxx/include/__assert +++ b/libcxx/include/__assert @@ -10,8 +10,8 @@ #ifndef _LIBCPP___ASSERT #define _LIBCPP___ASSERT -#include <__availability> #include <__config> +#include <__verbose_abort> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header @@ -45,7 +45,7 @@ # define _LIBCPP_ASSERT(expression, message) \ (__builtin_expect(static_cast(expression), 1) ? \ (void)0 : \ - ::std::__libcpp_assertion_handler("%s:%d: assertion %s failed: %s", __FILE__, __LINE__, #expression, message)) + ::std::__libcpp_verbose_abort("%s:%d: assertion %s failed: %s", __FILE__, __LINE__, #expression, message)) #elif !defined(_LIBCPP_ASSERTIONS_DISABLE_ASSUME) && __has_builtin(__builtin_assume) # define _LIBCPP_ASSERT(expression, message) \ (_LIBCPP_DIAGNOSTIC_PUSH \ @@ -56,11 +56,4 @@ # define _LIBCPP_ASSERT(expression, message) ((void)0) #endif -_LIBCPP_BEGIN_NAMESPACE_STD - -_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_ASSERTION_HANDLER _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 1, 2) -void __libcpp_assertion_handler(const char *__format, ...); - -_LIBCPP_END_NAMESPACE_STD - #endif // _LIBCPP___ASSERT diff --git a/libcxx/include/__availability b/libcxx/include/__availability --- a/libcxx/include/__availability +++ b/libcxx/include/__availability @@ -156,22 +156,21 @@ # define _LIBCPP_AVAILABILITY_FORMAT // # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format - // This controls whether the std::__libcpp_assertion_handler default - // assertion handler is provided by the library. + // This controls whether the default verbose abort handler is + // provided by the library. // - // Note that when users provide their own custom assertion handler, - // it doesn't matter whether the dylib provides a default handler, - // and the availability markup can actually give a false positive - // diagnostic (it will think that no handler is provided, when in - // reality the user has provided their own). + // Note that when users provide their own custom handler, it doesn't + // matter whether the dylib provides a default handler, and the + // availability markup can actually give a false positive diagnostic + // (it will think that no handler is provided, when in reality the + // user has provided their own). // - // Users can pass -D_LIBCPP_AVAILABILITY_CUSTOM_ASSERTION_HANDLER_PROVIDED + // Users can pass -D_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_HANDLER_PROVIDED // to the compiler to tell the library to ignore the fact that the // default handler isn't available on their deployment target. Note that - // defining this macro but failing to define a custom assertion handler - // will lead to a load-time error on back-deployment targets, so it - // should be avoided. -# define _LIBCPP_AVAILABILITY_DEFAULT_ASSERTION_HANDLER + // defining this macro but failing to define a custom handler will lead to + // a load-time error on back-deployment targets, so it should be avoided. +# define _LIBCPP_AVAILABILITY_DEFAULT_VERBOSE_ABORT_HANDLER #elif defined(__APPLE__) @@ -272,7 +271,7 @@ __attribute__((unavailable)) # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format -# define _LIBCPP_AVAILABILITY_DEFAULT_ASSERTION_HANDLER \ +# define _LIBCPP_AVAILABILITY_DEFAULT_VERBOSE_ABORT_HANDLER \ __attribute__((unavailable)) #else @@ -297,14 +296,14 @@ # define _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS #endif -// Define the special assertion handler availability attribute, which can be silenced by -// users if they provide their own custom assertion handler. The rest of the code should -// not use the *_DEFAULT_* macro directly, since that would make it ignore the fact that -// the user provided a custom handler. -#if defined(_LIBCPP_AVAILABILITY_CUSTOM_ASSERTION_HANDLER_PROVIDED) -# define _LIBCPP_AVAILABILITY_ASSERTION_HANDLER /* nothing */ +// Define the special verbose abort handler availability attribute, which can be silenced by +// users if they provide their own custom handler. The rest of the code should not use the +// *_DEFAULT_* macro directly, since that would make it ignore the fact that the user provided +// a custom handler. +#if defined(_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_HANDLER_PROVIDED) +# define _LIBCPP_AVAILABILITY_VERBOSE_ABORT_HANDLER /* nothing */ #else -# define _LIBCPP_AVAILABILITY_ASSERTION_HANDLER _LIBCPP_AVAILABILITY_DEFAULT_ASSERTION_HANDLER +# define _LIBCPP_AVAILABILITY_VERBOSE_ABORT_HANDLER _LIBCPP_AVAILABILITY_DEFAULT_VERBOSE_ABORT_HANDLER #endif #endif // _LIBCPP___AVAILABILITY diff --git a/libcxx/include/__verbose_abort b/libcxx/include/__verbose_abort new file mode 100644 --- /dev/null +++ b/libcxx/include/__verbose_abort @@ -0,0 +1,27 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___VERBOSE_ABORT +#define _LIBCPP___VERBOSE_ABORT + +#include <__availability> +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_VERBOSE_ABORT_HANDLER _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 1, 2) +void __libcpp_verbose_abort(const char *__format, ...); + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___VERBOSE_ABORT diff --git a/libcxx/include/module.modulemap.in b/libcxx/include/module.modulemap.in --- a/libcxx/include/module.modulemap.in +++ b/libcxx/include/module.modulemap.in @@ -1292,6 +1292,7 @@ module __tree { header "__tree" export * } module __tuple { private header "__tuple" export * } module __undef_macros { header "__undef_macros" export * } + module __verbose_abort { header "__verbose_abort" export * } module experimental { requires cplusplus11 diff --git a/libcxx/lib/abi/CHANGELOG.TXT b/libcxx/lib/abi/CHANGELOG.TXT --- a/libcxx/lib/abi/CHANGELOG.TXT +++ b/libcxx/lib/abi/CHANGELOG.TXT @@ -64,7 +64,7 @@ Symbol removed: _ZTSNSt3__18__c_nodeE Symbol removed: _ZTVNSt3__18__c_nodeE -* b0fd9497af6d and 7de5aca84c54 - [libc++] Add a lightweight overridable assertion handler +* b0fd9497af6d, 7de5aca84c54 and XXXXXXXX - [libc++] Add a lightweight overridable assertion handler This patch adds a lightweight assertion handler mechanism that can be overriden at link-time in a fashion similar to `operator new`. A default @@ -73,7 +73,7 @@ All platforms ------------- - Symbol added: _ZNSt3__126__libcpp_assertion_handlerEPKcz + Symbol added: _ZNSt3__122__libcpp_verbose_abortEPKcz ------------ Version 14.0 diff --git a/libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.abilist b/libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.abilist --- a/libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.abilist +++ b/libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.abilist @@ -1534,7 +1534,7 @@ {'is_defined': True, 'name': '__ZNSt3__123__libcpp_atomic_monitorEPVKNS_17__cxx_atomic_implIxNS_22__cxx_atomic_base_implIxEEEE', 'type': 'FUNC'} {'is_defined': True, 'name': '__ZNSt3__123__libcpp_atomic_monitorEPVKv', 'type': 'FUNC'} {'is_defined': True, 'name': '__ZNSt3__125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE', 'type': 'FUNC'} -{'is_defined': True, 'name': '__ZNSt3__126__libcpp_assertion_handlerEPKcz', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__122__libcpp_verbose_abortEPKcz', 'type': 'FUNC'} {'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_', 'type': 'FUNC'} {'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_', 'type': 'FUNC'} {'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_', 'type': 'FUNC'} diff --git a/libcxx/lib/abi/powerpc-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist b/libcxx/lib/abi/powerpc-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist --- a/libcxx/lib/abi/powerpc-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist +++ b/libcxx/lib/abi/powerpc-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist @@ -1678,7 +1678,7 @@ {'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_', 'storage_mapping_class': 'DS', 'type': 'FUNC'} {'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_', 'storage_mapping_class': 'DS', 'type': 'FUNC'} {'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_', 'storage_mapping_class': 'DS', 'type': 'FUNC'} -{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__126__libcpp_assertion_handlerEPKcz', 'storage_mapping_class': 'DS', 'type': 'FUNC'} +{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__122__libcpp_verbose_abortEPKcz', 'storage_mapping_class': 'DS', 'type': 'FUNC'} {'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'} {'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'} {'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'} diff --git a/libcxx/lib/abi/powerpc64-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist b/libcxx/lib/abi/powerpc64-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist --- a/libcxx/lib/abi/powerpc64-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist +++ b/libcxx/lib/abi/powerpc64-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist @@ -1678,7 +1678,7 @@ {'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_', 'storage_mapping_class': 'DS', 'type': 'FUNC'} {'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_', 'storage_mapping_class': 'DS', 'type': 'FUNC'} {'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_', 'storage_mapping_class': 'DS', 'type': 'FUNC'} -{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__126__libcpp_assertion_handlerEPKcz', 'storage_mapping_class': 'DS', 'type': 'FUNC'} +{'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__122__libcpp_verbose_abortEPKcz', 'storage_mapping_class': 'DS', 'type': 'FUNC'} {'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'} {'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'} {'import_export': 'wEXP', 'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_', 'storage_mapping_class': 'DS', 'type': 'FUNC'} diff --git a/libcxx/lib/abi/x86_64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.abilist b/libcxx/lib/abi/x86_64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.abilist --- a/libcxx/lib/abi/x86_64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.abilist +++ b/libcxx/lib/abi/x86_64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.abilist @@ -1534,7 +1534,7 @@ {'is_defined': True, 'name': '__ZNSt3__123__libcpp_atomic_monitorEPVKNS_17__cxx_atomic_implIxNS_22__cxx_atomic_base_implIxEEEE', 'type': 'FUNC'} {'is_defined': True, 'name': '__ZNSt3__123__libcpp_atomic_monitorEPVKv', 'type': 'FUNC'} {'is_defined': True, 'name': '__ZNSt3__125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE', 'type': 'FUNC'} -{'is_defined': True, 'name': '__ZNSt3__126__libcpp_assertion_handlerEPKcz', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__122__libcpp_verbose_abortEPKcz', 'type': 'FUNC'} {'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_', 'type': 'FUNC'} {'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_', 'type': 'FUNC'} {'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_', 'type': 'FUNC'} diff --git a/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.abilist b/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.abilist --- a/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.abilist +++ b/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.abilist @@ -1225,7 +1225,7 @@ {'is_defined': True, 'name': '_ZNSt3__123__libcpp_atomic_monitorEPVKNS_17__cxx_atomic_implIiNS_22__cxx_atomic_base_implIiEEEE', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__123__libcpp_atomic_monitorEPVKv', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE', 'type': 'FUNC'} -{'is_defined': True, 'name': '_ZNSt3__126__libcpp_assertion_handlerEPKcz', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__122__libcpp_verbose_abortEPKcz', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_', 'type': 'FUNC'} diff --git a/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.noexceptions.nonew.abilist b/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.noexceptions.nonew.abilist --- a/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.noexceptions.nonew.abilist +++ b/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.noexceptions.nonew.abilist @@ -1197,7 +1197,7 @@ {'is_defined': True, 'name': '_ZNSt3__123__libcpp_atomic_monitorEPVKNS_17__cxx_atomic_implIiNS_22__cxx_atomic_base_implIiEEEE', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__123__libcpp_atomic_monitorEPVKv', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE', 'type': 'FUNC'} -{'is_defined': True, 'name': '_ZNSt3__126__libcpp_assertion_handlerEPKcz', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__122__libcpp_verbose_abortEPKcz', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_', 'type': 'FUNC'} diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt --- a/libcxx/src/CMakeLists.txt +++ b/libcxx/src/CMakeLists.txt @@ -4,7 +4,6 @@ set(LIBCXX_SOURCES algorithm.cpp any.cpp - assert.cpp atomic.cpp barrier.cpp bind.cpp @@ -62,6 +61,7 @@ valarray.cpp variant.cpp vector.cpp + verbose_abort.cpp ) if (LIBCXX_ENABLE_DEBUG_MODE OR LIBCXX_ENABLE_BACKWARDS_COMPATIBILITY_DEBUG_MODE_SYMBOLS) diff --git a/libcxx/src/assert.cpp b/libcxx/src/verbose_abort.cpp rename from libcxx/src/assert.cpp rename to libcxx/src/verbose_abort.cpp --- a/libcxx/src/assert.cpp +++ b/libcxx/src/verbose_abort.cpp @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#include <__assert> #include <__config> +#include <__verbose_abort> #include #include #include @@ -25,7 +25,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_WEAK -void __libcpp_assertion_handler(char const* format, ...) { +void __libcpp_verbose_abort(char const* format, ...) { // Write message to stderr. We do this before formatting into a // buffer so that we still get some information out if that fails. { diff --git a/libcxx/test/libcxx/assertions/customize_handler.backdeployment.pass.cpp b/libcxx/test/libcxx/assertions/customize_handler.backdeployment.pass.cpp --- a/libcxx/test/libcxx/assertions/customize_handler.backdeployment.pass.cpp +++ b/libcxx/test/libcxx/assertions/customize_handler.backdeployment.pass.cpp @@ -7,17 +7,17 @@ //===----------------------------------------------------------------------===// // Make sure that we can enable assertions when we back-deploy to older platforms -// if we define _LIBCPP_AVAILABILITY_CUSTOM_ASSERTION_HANDLER_PROVIDED. +// if we define _LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_HANDLER_PROVIDED. // // Note that this test isn't really different from customize_handler.pass.cpp when // run outside of back-deployment scenarios, but we still run it all the time. -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1 -D_LIBCPP_AVAILABILITY_CUSTOM_ASSERTION_HANDLER_PROVIDED +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1 -D_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_HANDLER_PROVIDED #include bool handler_called = false; -void std::__libcpp_assertion_handler(char const*, ...) { +void std::__libcpp_verbose_abort(char const*, ...) { handler_called = true; } diff --git a/libcxx/test/libcxx/assertions/customize_handler.pass.cpp b/libcxx/test/libcxx/assertions/customize_handler.pass.cpp --- a/libcxx/test/libcxx/assertions/customize_handler.pass.cpp +++ b/libcxx/test/libcxx/assertions/customize_handler.pass.cpp @@ -17,7 +17,7 @@ #include bool handler_called = false; -void std::__libcpp_assertion_handler(char const*, ...) { +void std::__libcpp_verbose_abort(char const*, ...) { handler_called = true; } diff --git a/libcxx/test/libcxx/assertions/debug_mode_compatibility.pass.cpp b/libcxx/test/libcxx/assertions/debug_mode_compatibility.pass.cpp --- a/libcxx/test/libcxx/assertions/debug_mode_compatibility.pass.cpp +++ b/libcxx/test/libcxx/assertions/debug_mode_compatibility.pass.cpp @@ -19,7 +19,7 @@ #include bool handler_called = false; -void std::__libcpp_assertion_handler(char const*, ...) { +void std::__libcpp_verbose_abort(char const*, ...) { handler_called = true; } diff --git a/libcxx/test/libcxx/assertions/default_handler.availability.verify.cpp b/libcxx/test/libcxx/assertions/default_handler.availability.verify.cpp --- a/libcxx/test/libcxx/assertions/default_handler.availability.verify.cpp +++ b/libcxx/test/libcxx/assertions/default_handler.availability.verify.cpp @@ -16,5 +16,5 @@ #include // any header would work void f() { - _LIBCPP_ASSERT(true, "message"); // expected-error {{'__libcpp_assertion_handler' is unavailable}} + _LIBCPP_ASSERT(true, "message"); // expected-error {{'__libcpp_verbose_abort' is unavailable}} } diff --git a/libcxx/test/libcxx/assertions/headers_declare_assertion_handler.sh.cpp b/libcxx/test/libcxx/assertions/headers_declare_handler.sh.cpp rename from libcxx/test/libcxx/assertions/headers_declare_assertion_handler.sh.cpp rename to libcxx/test/libcxx/assertions/headers_declare_handler.sh.cpp --- a/libcxx/test/libcxx/assertions/headers_declare_assertion_handler.sh.cpp +++ b/libcxx/test/libcxx/assertions/headers_declare_handler.sh.cpp @@ -34,7 +34,7 @@ // {run}: %{{build}} -DTEST_{i} #if defined(TEST_{i}){restrictions} # include <{header}> - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif """.format(**vars)) @@ -55,715 +55,715 @@ // RUN: %{build} -DTEST_0 #if defined(TEST_0) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_1 #if defined(TEST_1) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_2 #if defined(TEST_2) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_3 #if defined(TEST_3) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_4 #if defined(TEST_4) && !defined(_LIBCPP_HAS_NO_THREADS) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_5 #if defined(TEST_5) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_6 #if defined(TEST_6) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_7 #if defined(TEST_7) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_8 #if defined(TEST_8) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_9 #if defined(TEST_9) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_10 #if defined(TEST_10) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_11 #if defined(TEST_11) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_12 #if defined(TEST_12) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_13 #if defined(TEST_13) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_14 #if defined(TEST_14) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_15 #if defined(TEST_15) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_16 #if defined(TEST_16) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_17 #if defined(TEST_17) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_18 #if defined(TEST_18) && !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_19 #if defined(TEST_19) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_20 #if defined(TEST_20) && !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_21 #if defined(TEST_21) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_22 #if defined(TEST_22) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_24 #if defined(TEST_24) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_25 #if defined(TEST_25) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_26 #if defined(TEST_26) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_27 #if defined(TEST_27) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_28 #if defined(TEST_28) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_29 #if defined(TEST_29) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_30 #if defined(TEST_30) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_31 #if defined(TEST_31) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_32 #if defined(TEST_32) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_33 #if defined(TEST_33) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_34 #if defined(TEST_34) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_35 #if defined(TEST_35) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_36 #if defined(TEST_36) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_37 #if defined(TEST_37) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_39 #if defined(TEST_39) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_40 #if defined(TEST_40) && !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_41 #if defined(TEST_41) && !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_42 #if defined(TEST_42) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_44 #if defined(TEST_44) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_45 #if defined(TEST_45) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_47 #if defined(TEST_47) && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_49 #if defined(TEST_49) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_50 #if defined(TEST_50) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_51 #if defined(TEST_51) && !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_52 #if defined(TEST_52) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_53 #if defined(TEST_53) && !defined(_LIBCPP_HAS_NO_THREADS) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_54 #if defined(TEST_54) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_56 #if defined(TEST_56) && !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_57 #if defined(TEST_57) && !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_58 #if defined(TEST_58) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_59 #if defined(TEST_59) && !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_60 #if defined(TEST_60) && !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_61 #if defined(TEST_61) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_62 #if defined(TEST_62) && !defined(_LIBCPP_HAS_NO_THREADS) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_63 #if defined(TEST_63) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_65 #if defined(TEST_65) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_66 #if defined(TEST_66) && !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_68 #if defined(TEST_68) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_70 #if defined(TEST_70) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_71 #if defined(TEST_71) && !defined(_LIBCPP_HAS_NO_THREADS) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_72 #if defined(TEST_72) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_73 #if defined(TEST_73) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_74 #if defined(TEST_74) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_75 #if defined(TEST_75) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_76 #if defined(TEST_76) && !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_77 #if defined(TEST_77) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_78 #if defined(TEST_78) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_79 #if defined(TEST_79) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_80 #if defined(TEST_80) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_81 #if defined(TEST_81) && !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_82 #if defined(TEST_82) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_83 #if defined(TEST_83) && !defined(_LIBCPP_HAS_NO_THREADS) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_84 #if defined(TEST_84) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_86 #if defined(TEST_86) && !defined(_LIBCPP_HAS_NO_THREADS) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_87 #if defined(TEST_87) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_88 #if defined(TEST_88) && !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_89 #if defined(TEST_89) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_93 #if defined(TEST_93) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_97 #if defined(TEST_97) && !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_98 #if defined(TEST_98) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_100 #if defined(TEST_100) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_101 #if defined(TEST_101) && !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_102 #if defined(TEST_102) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_104 #if defined(TEST_104) && !defined(_LIBCPP_HAS_NO_THREADS) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_105 #if defined(TEST_105) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_106 #if defined(TEST_106) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_107 #if defined(TEST_107) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_108 #if defined(TEST_108) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_110 #if defined(TEST_110) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_111 #if defined(TEST_111) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_112 #if defined(TEST_112) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_113 #if defined(TEST_113) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_114 #if defined(TEST_114) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_115 #if defined(TEST_115) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_116 #if defined(TEST_116) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_119 #if defined(TEST_119) && __cplusplus >= 201103L # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_120 #if defined(TEST_120) && __cplusplus >= 201103L && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_COROUTINES) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_121 #if defined(TEST_121) && __cplusplus >= 201103L # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_122 #if defined(TEST_122) && __cplusplus >= 201103L # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_123 #if defined(TEST_123) && __cplusplus >= 201103L # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_124 #if defined(TEST_124) && __cplusplus >= 201103L # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_125 #if defined(TEST_125) && __cplusplus >= 201103L # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_126 #if defined(TEST_126) && __cplusplus >= 201103L # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_127 #if defined(TEST_127) && __cplusplus >= 201103L # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_128 #if defined(TEST_128) && __cplusplus >= 201103L # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_129 #if defined(TEST_129) && !defined(_LIBCPP_HAS_NO_LOCALIZATION) && __cplusplus >= 201103L # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_130 #if defined(TEST_130) && __cplusplus >= 201103L # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_131 #if defined(TEST_131) && __cplusplus >= 201103L # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_132 #if defined(TEST_132) && __cplusplus >= 201103L # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_133 #if defined(TEST_133) && __cplusplus >= 201103L # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_134 #if defined(TEST_134) && __cplusplus >= 201103L # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_135 #if defined(TEST_135) && __cplusplus >= 201103L # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_136 #if defined(TEST_136) && __cplusplus >= 201103L # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_137 #if defined(TEST_137) && __cplusplus >= 201103L # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_138 #if defined(TEST_138) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // RUN: %{build} -DTEST_139 #if defined(TEST_139) # include - using HandlerType = decltype(std::__libcpp_assertion_handler); + using HandlerType = decltype(std::__libcpp_verbose_abort); #endif // GENERATED-MARKER diff --git a/libcxx/test/support/check_assertion.h b/libcxx/test/support/check_assertion.h --- a/libcxx/test/support/check_assertion.h +++ b/libcxx/test/support/check_assertion.h @@ -236,7 +236,7 @@ std::string stderr_from_child_; }; -void std::__libcpp_assertion_handler(char const* format, ...) { +void std::__libcpp_verbose_abort(char const* format, ...) { assert(!GlobalMatcher().empty()); // Extract information from the error message. This has to stay synchronized with diff --git a/libcxx/utils/generate_header_tests.py b/libcxx/utils/generate_header_tests.py --- a/libcxx/utils/generate_header_tests.py +++ b/libcxx/utils/generate_header_tests.py @@ -64,7 +64,7 @@ private_headers_still_public_in_modules = [ '__assert', '__bsd_locale_defaults.h', '__bsd_locale_fallbacks.h', '__config', '__config_site.in', '__debug', '__hash_table', - '__threading_support', '__tree', '__undef_macros' + '__threading_support', '__tree', '__undef_macros', '__verbose_abort' ] def find_script(file): @@ -136,7 +136,7 @@ 'private_headers_still_public_in_modules': private_headers_still_public_in_modules } - produce(test.joinpath('libcxx/assertions/headers_declare_assertion_handler.sh.cpp'), variables) + produce(test.joinpath('libcxx/assertions/headers_declare_handler.sh.cpp'), variables) produce(test.joinpath('libcxx/clang_tidy.sh.cpp'), variables) produce(test.joinpath('libcxx/double_include.sh.cpp'), variables) produce(test.joinpath('libcxx/min_max_macros.compile.pass.cpp'), variables)