@@ -92,18 +92,19 @@ class _LIBCPP_EXPORTED_FROM_ABI exception_ptr {
9292 friend _LIBCPP_EXPORTED_FROM_ABI void rethrow_exception (exception_ptr);
9393};
9494
95+ # if _LIBCPP_HAS_EXCEPTIONS
9596template <class _Ep >
9697_LIBCPP_HIDE_FROM_ABI exception_ptr __make_exception_ptr_explicit (_Ep& __e) _NOEXCEPT {
9798 using _Ep2 = __decay_t <_Ep>;
9899 void * __ex = __cxxabiv1::__cxa_allocate_exception (sizeof (_Ep));
99- # ifdef __wasm__
100+ # ifdef __wasm__
100101 auto __cleanup = [](void * __p) -> void * {
101102 std::__destroy_at (static_cast <_Ep2*>(__p));
102103 return __p;
103104 };
104- # else
105+ # else
105106 auto __cleanup = [](void * __p) { std::__destroy_at (static_cast <_Ep2*>(__p)); };
106- # endif
107+ # endif
107108 (void )__cxxabiv1::__cxa_init_primary_exception (__ex, const_cast <std::type_info*>(&typeid (_Ep)), __cleanup);
108109
109110 try {
@@ -126,7 +127,6 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr __make_exception_ptr_via_throw(_Ep& __e) _NO
126127
127128template <class _Ep >
128129_LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr (_Ep __e) _NOEXCEPT {
129- # if _LIBCPP_HAS_EXCEPTIONS
130130 // Objective-C exceptions are thrown via pointer. When throwing an Objective-C exception,
131131 // Clang generates a call to `objc_exception_throw` instead of the usual `__cxa_throw`.
132132 // That function creates an exception with a special Objective-C typeinfo instead of
@@ -147,12 +147,13 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT {
147147# else
148148 return std::__make_exception_ptr_via_throw (__e);
149149# endif
150-
151- # else // !LIBCPP_HAS_EXCEPTIONS
152- ((void )__e);
150+ }
151+ # else // !_LIBCPP_HAS_EXCEPTIONS
152+ template <class _Ep >
153+ _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr (_Ep) _NOEXCEPT {
153154 std::abort ();
154- # endif
155155}
156+ # endif // _LIBCPP_HAS_EXCEPTIONS
156157
157158#else // _LIBCPP_ABI_MICROSOFT
158159
0 commit comments