* include/bits/allocator.h (__shrink_to_fit_aux<T, true>::_S_do_it):
Do nothing if exceptions are disabled.
* include/bits/basic_string.h (basic_string::shrink_to_fit): Likewise.
From-SVN: r227870
+2015-09-17 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/bits/allocator.h (__shrink_to_fit_aux<T, true>::_S_do_it):
+ Do nothing if exceptions are disabled.
+ * include/bits/basic_string.h (basic_string::shrink_to_fit): Likewise.
+
2015-09-16 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/67173
static bool
_S_do_it(_Tp& __c) noexcept
{
- __try
+#if __cpp_exceptions
+ try
{
_Tp(__make_move_if_noexcept_iterator(__c.begin()),
__make_move_if_noexcept_iterator(__c.end()),
__c.get_allocator()).swap(__c);
return true;
}
- __catch(...)
+ catch(...)
{ return false; }
+#else
+ return false;
+#endif
}
};
#endif
void
shrink_to_fit() noexcept
{
+#if __cpp_exceptions
if (capacity() > size())
{
- __try
+ try
{ reserve(0); }
- __catch(...)
+ catch(...)
{ }
}
+#endif
}
#endif
void
shrink_to_fit() _GLIBCXX_NOEXCEPT
{
+#if __cpp_exceptions
if (capacity() > size())
{
- __try
+ try
{ reserve(0); }
- __catch(...)
+ catch(...)
{ }
+#endif
}
}
#endif