diff --git a/libcxx/include/__utility/exception_guard.h b/libcxx/include/__utility/exception_guard.h --- a/libcxx/include/__utility/exception_guard.h +++ b/libcxx/include/__utility/exception_guard.h @@ -58,7 +58,6 @@ // } // -#ifndef _LIBCPP_NO_EXCEPTIONS template struct __exception_guard_exceptions { __exception_guard_exceptions() = delete; @@ -91,9 +90,6 @@ _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(__exception_guard_exceptions); -template -using __exception_guard = __exception_guard_exceptions<_Rollback>; -#else // _LIBCPP_NO_EXCEPTIONS template struct __exception_guard_noexceptions { __exception_guard_noexceptions() = delete; @@ -125,9 +121,13 @@ _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(__exception_guard_noexceptions); +#ifdef _LIBCPP_NO_EXCEPTIONS template using __exception_guard = __exception_guard_noexceptions<_Rollback>; -#endif // _LIBCPP_NO_EXCEPTIONS +#else +template +using __exception_guard = __exception_guard_exceptions<_Rollback>; +#endif template _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __exception_guard<_Rollback> __make_exception_guard(_Rollback __rollback) {