summaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp/libcxx/include/__debug
diff options
context:
space:
mode:
authorAndrey Khalyavin <[email protected]>2022-04-15 02:46:40 +0300
committerAndrey Khalyavin <[email protected]>2022-04-15 02:46:40 +0300
commitc5bfd90690e2df55f55d1831b0edd2e1c7241582 (patch)
treecda6bc446bf17fc110b67126b4c5ddc640fa427b /contrib/libs/cxxsupp/libcxx/include/__debug
parent599463a2ac4bda8536564ec6d7b798447755f05f (diff)
Update libc++ to b6d87773 (14 Jan 2022).
Notable changes: * implement operator << for filesystem::directory_entry * add std::ranges::in_in_result * add std::ranges::owning_view * add std::ranges::cdata * add std::ranges::construct_at and destroy{,_n,_at} * small fixes in std::ranges::data * SFINAE away std::ranges::cbegin(const T&&) for non-borrowed T * use arc4random to implement std::random_device on Apple * introduce __fits_in_sso to put constexpr check into a central place * introduce __debug_db_insert_c to put #if and constexpr check into a central place ref:b3dd06bd52f06e8939227ca0f0a5873d0c211e48
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/include/__debug')
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__debug15
1 files changed, 13 insertions, 2 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/include/__debug b/contrib/libs/cxxsupp/libcxx/include/__debug
index 42f6cef4c07..29c51b2f2f4 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__debug
+++ b/contrib/libs/cxxsupp/libcxx/include/__debug
@@ -12,6 +12,7 @@
#include <__config>
#include <iosfwd>
+#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -22,9 +23,9 @@
#endif
#if _LIBCPP_DEBUG_LEVEL >= 1 || defined(_LIBCPP_BUILDING_LIBRARY)
-# include <cstdlib>
-# include <cstdio>
# include <cstddef>
+# include <cstdio>
+# include <cstdlib>
#endif
#if _LIBCPP_DEBUG_LEVEL == 0
@@ -268,6 +269,16 @@ _LIBCPP_FUNC_VIS const __libcpp_db* __get_const_db();
#endif // _LIBCPP_DEBUG_LEVEL == 2 || defined(_LIBCPP_BUILDING_LIBRARY)
+template <class _Tp>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 inline void __debug_db_insert_c(_Tp* __c) {
+#if _LIBCPP_DEBUG_LEVEL == 2
+ if (!__libcpp_is_constant_evaluated())
+ __get_db()->__insert_c(__c);
+#else
+ (void)(__c);
+#endif
+}
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_DEBUG_H