summaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp/libcxx/src/assert.cpp
diff options
context:
space:
mode:
authorhalyavin <[email protected]>2022-07-21 11:17:19 +0300
committerhalyavin <[email protected]>2022-07-21 11:17:19 +0300
commitb78ae8ac7797d88986dfa1526ea11fcbdb4f5f6f (patch)
treef4368f9265036a664df40ae4943cabd4f272d414 /contrib/libs/cxxsupp/libcxx/src/assert.cpp
parentb651f08845dea01bbd05b6b7d56aba3992374706 (diff)
Update libc++ to 34313583 (20 Feb 2022).
Notable changes: * replace _LIBCPP_INLINE_VISIBILITY with _LIBCPP_HIDE_FROM_ABI in __filesystem/operations.h * implement sortable and mergeable concepts * replace __uncvref with __uncvref_t * implement consistent stateful allocator behavior in std::basic_string::operator+ * remove some _LIBCPP_CXX03_LANG ifdef's * move _LIBCPP_ASSERT related code to a separate file * enable std::hash<Enum> in C++11 mode * make algorithm includes more granular * implement range functionality for std::istream_iterator * add debug check in basic_string::insert * replace "" with <> in includes in src/ files for consistency with include/ * add push/pop macros defines in src/ files for consistency with include/ * add availability annotations to optional operations * remove conditional noexcept from view_interface --- this is allowed by the standard * replace _LIBCPP_SAFE_STATIC with _LIBCPP_CONSTINIT * guard most of std::ranges under _LIBCPP_HAS_NO_INCOMPLETE_RANGES * remove priority pragma for AIX from locale.cpp because it is ignored anyway
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/src/assert.cpp')
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/assert.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/src/assert.cpp b/contrib/libs/cxxsupp/libcxx/src/assert.cpp
new file mode 100644
index 00000000000..21a3863cd05
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/src/assert.cpp
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include <__assert>
+#include <__config>
+#include <cstdio>
+#include <cstdlib>
+#include <string>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+std::string __libcpp_debug_info::what() const {
+ string msg = __file_;
+ msg += ":" + std::to_string(__line_) + ": _LIBCPP_ASSERT '";
+ msg += __pred_;
+ msg += "' failed. ";
+ msg += __msg_;
+ return msg;
+}
+
+_LIBCPP_NORETURN void __libcpp_abort_debug_function(__libcpp_debug_info const& info) {
+ std::fprintf(stderr, "%s\n", info.what().c_str());
+ std::abort();
+}
+
+_LIBCPP_CONSTINIT __libcpp_debug_function_type __libcpp_debug_function = __libcpp_abort_debug_function;
+
+bool __libcpp_set_debug_function(__libcpp_debug_function_type __func) {
+ __libcpp_debug_function = __func;
+ return true;
+}
+
+_LIBCPP_END_NAMESPACE_STD