basic_string.h (basic_string::basic_string()): Make noexcept conditional on allocator...
authorJonathan Wakely <jwakely@redhat.com>
Wed, 13 May 2015 13:32:36 +0000 (14:32 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 13 May 2015 13:32:36 +0000 (14:32 +0100)
* include/bits/basic_string.h (basic_string::basic_string()): Make
noexcept conditional on allocator (LWG 2455).

From-SVN: r223160

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/basic_string.h

index af4d5be54c6c2cba5648b81be42d7f5e1fca3caf..3d20ad4e316d1abcaf26a3e29b3651ed46971d5c 100644 (file)
@@ -1,5 +1,8 @@
 2015-05-13  Jonathan Wakely  <jwakely@redhat.com>
 
+       * 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
index 3e3eef44b4a14bc937a4a620e532bcb9a39abd08..093f5021de74fe097a83fe76d3a0dbd0a6bfe4c5 100644 (file)
@@ -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); }