https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85772
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- Also review it for noexcept, so that for example the copy constructor is noexcept when using the COW base: diff --git a/libstdc++-v3/include/ext/rc_string_base.h b/libstdc++-v3/include/ext/rc_string_base.h index 46f189331f7..7e027cf6fb6 100644 --- a/libstdc++-v3/include/ext/rc_string_base.h +++ b/libstdc++-v3/include/ext/rc_string_base.h @@ -311,7 +311,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __rc_string_base(const _Alloc& __a); - __rc_string_base(const __rc_string_base& __rcs); + __rc_string_base(const __rc_string_base& __rcs) _GLIBCXX_USE_NOEXCEPT; #if __cplusplus >= 201103L __rc_string_base(__rc_string_base&& __rcs) diff --git a/libstdc++-v3/include/ext/vstring.h b/libstdc++-v3/include/ext/vstring.h index 605311e9a28..8834bdcc36e 100644 --- a/libstdc++-v3/include/ext/vstring.h +++ b/libstdc++-v3/include/ext/vstring.h @@ -143,6 +143,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @param __str Source string. */ __versa_string(const __versa_string& __str) + _GLIBCXX_NOEXCEPT_IF(std::is_nothrow_copy_constructible<__vstring_base>()) : __vstring_base(__str) { } #if __cplusplus >= 201103L