diff --git a/include/thread b/include/thread index e21a09fff..8d3aab2ae 100644 --- a/include/thread +++ b/include/thread @@ -144,9 +144,11 @@ template __thread_specific_ptr<_Tp>::__thread_specific_ptr() { int __ec = pthread_key_create(&__key_, &__thread_specific_ptr::__at_thread_exit); +#ifndef _LIBCPP_NO_EXCEPTIONS if (__ec) throw system_error(error_code(__ec, system_category()), "__thread_specific_ptr construction failed"); +#endif } template