diff --git a/libstdc++-v3/include/bits/basic_string.tcc b/libstdc++-v3/include/bits/basic_string.tcc index a64b63a37fbb6d41ec2fa57f654292cc19d8323d..95d2fdbd6d6a25eda2f7759362897927a97c8387 100644 --- a/libstdc++-v3/include/bits/basic_string.tcc +++ b/libstdc++-v3/include/bits/basic_string.tcc @@ -1179,6 +1179,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION basic_string<_CharT, _Traits, _Alloc>:: reserve() { +#if __cpp_exceptions if (length() < capacity() || _M_rep()->_M_is_shared()) try { @@ -1191,6 +1192,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { throw; } catch (...) { /* swallow the exception */ } +#endif } template<typename _CharT, typename _Traits, typename _Alloc>