diff options
| author | hiddenpath <[email protected]> | 2024-02-21 23:16:42 +0300 |
|---|---|---|
| committer | hiddenpath <[email protected]> | 2024-02-21 23:33:25 +0300 |
| commit | 9052eb5cc304b8da8885fc4e3364ebddc16945f3 (patch) | |
| tree | 3c252f6161dd0745c7732d74c9304c000645ab47 /contrib/libs/cxxsupp/libcxx/include/__utility/exception_guard.h | |
| parent | f5eb715f103692e7c7536e13bef3f281fd78e5e7 (diff) | |
Update libcxx to llvmorg-17.0.6
Update libcxx to llvmorg-17.0.6
c871ef572c71b4fef22d4a9e65bcebc57e625aea
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/include/__utility/exception_guard.h')
| -rw-r--r-- | contrib/libs/cxxsupp/libcxx/include/__utility/exception_guard.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/exception_guard.h b/contrib/libs/cxxsupp/libcxx/include/__utility/exception_guard.h index 46f9359a5c0..389fca6c710 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__utility/exception_guard.h +++ b/contrib/libs/cxxsupp/libcxx/include/__utility/exception_guard.h @@ -19,6 +19,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD // __exception_guard is a helper class for writing code with the strong exception guarantee. @@ -41,7 +44,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD // less common, especially one that tries to catch an exception through -fno-exceptions code. // // __exception_guard can help greatly simplify code that would normally be cluttered by -// `#if _LIBCPP_NO_EXCEPTIONS`. For example: +// `#if _LIBCPP_HAS_NO_EXCEPTIONS`. For example: // // template <class Iterator, class Size, class OutputIterator> // Iterator uninitialized_copy_n(Iterator iter, Size n, OutputIterator out) { @@ -58,7 +61,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD // } // -#ifndef _LIBCPP_NO_EXCEPTIONS template <class _Rollback> struct __exception_guard_exceptions { __exception_guard_exceptions() = delete; @@ -92,9 +94,6 @@ private: _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(__exception_guard_exceptions); template <class _Rollback> -using __exception_guard = __exception_guard_exceptions<_Rollback>; -#else // _LIBCPP_NO_EXCEPTIONS -template <class _Rollback> struct __exception_guard_noexceptions { __exception_guard_noexceptions() = delete; _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 @@ -116,7 +115,7 @@ struct __exception_guard_noexceptions { } _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_NODEBUG ~__exception_guard_noexceptions() { - _LIBCPP_ASSERT(__completed_, "__exception_guard not completed with exceptions disabled"); + _LIBCPP_ASSERT_UNCATEGORIZED(__completed_, "__exception_guard not completed with exceptions disabled"); } private: @@ -125,9 +124,13 @@ private: _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(__exception_guard_noexceptions); +#ifdef _LIBCPP_HAS_NO_EXCEPTIONS template <class _Rollback> using __exception_guard = __exception_guard_noexceptions<_Rollback>; -#endif // _LIBCPP_NO_EXCEPTIONS +#else +template <class _Rollback> +using __exception_guard = __exception_guard_exceptions<_Rollback>; +#endif template <class _Rollback> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __exception_guard<_Rollback> __make_exception_guard(_Rollback __rollback) { @@ -136,4 +139,6 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __exception_guard<_Rollback> __make_exce _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___UTILITY_TRANSACTION_H |
