From: Jonathan Wakely Date: Wed, 13 May 2015 13:32:36 +0000 (+0100) Subject: basic_string.h (basic_string::basic_string()): Make noexcept conditional on allocator... X-Git-Tag: basepoints/gcc-7~7129 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bcb896abe8e24ddf1f120e66bea6cd16e3fd0ca3;p=thirdparty%2Fgcc.git basic_string.h (basic_string::basic_string()): Make noexcept conditional on allocator (LWG 2455). * include/bits/basic_string.h (basic_string::basic_string()): Make noexcept conditional on allocator (LWG 2455). From-SVN: r223160 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index af4d5be54c6c..3d20ad4e316d 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,8 @@ 2015-05-13 Jonathan Wakely + * include/bits/basic_string.h (basic_string::basic_string()): Make + noexcept conditional on allocator (LWG 2455). + * include/std/complex (polar): Check for negative rho (LWG 2459). * include/experimental/tuple (apply): Handle pointers to member (LWG diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h index 3e3eef44b4a1..093f5021de74 100644 --- a/libstdc++-v3/include/bits/basic_string.h +++ b/libstdc++-v3/include/bits/basic_string.h @@ -377,7 +377,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 /** * @brief Default constructor creates an empty string. */ - basic_string() _GLIBCXX_NOEXCEPT + basic_string() +#if __cplusplus >= 201103L + noexcept(is_nothrow_default_constructible<_Alloc>::value) +#endif : _M_dataplus(_M_local_data()) { _M_set_length(0); }