aboutsummaryrefslogtreecommitdiff
path: root/libcxx/include/__assert
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/include/__assert')
-rw-r--r--libcxx/include/__assert19
1 files changed, 4 insertions, 15 deletions
diff --git a/libcxx/include/__assert b/libcxx/include/__assert
index 82db2cf052b5..9c0cd1b1192a 100644
--- a/libcxx/include/__assert
+++ b/libcxx/include/__assert
@@ -10,20 +10,16 @@
#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
#endif
-// This is for backwards compatibility with code that might have been enabling
-// assertions through the Debug mode previously.
-// TODO: In LLVM 16, make it an error to define _LIBCPP_DEBUG
+// TODO: Remove in LLVM 17.
#if defined(_LIBCPP_DEBUG)
-# ifndef _LIBCPP_ENABLE_ASSERTIONS
-# define _LIBCPP_ENABLE_ASSERTIONS 1
-# endif
+# error "Defining _LIBCPP_DEBUG is not supported anymore. Please use _LIBCPP_ENABLE_DEBUG_MODE instead."
#endif
// Automatically enable assertions when the debug mode is enabled.
@@ -45,7 +41,7 @@
# define _LIBCPP_ASSERT(expression, message) \
(__builtin_expect(static_cast<bool>(expression), 1) ? \
(void)0 : \
- ::std::__libcpp_assertion_handler("%s:%d: assertion %s failed: %s", __FILE__, __LINE__, #expression, message))
+ _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 +52,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