From: Nathan Blackburn Date: Wed, 22 Jul 2026 16:48:38 +0000 (+0000) Subject: libstdc++: Remove noexcept from basic_string instantiations [PR126327] X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;ds=inline;p=thirdparty%2Fgcc.git libstdc++: Remove noexcept from basic_string instantiations [PR126327] The explicit instantiations of basic_string's default constructor used an unconditional noexcept specification. For the fully-dynamic COW string, those default constructors are noexcept(false). Remove noexcept from both the char and wchar_t instantiations. libstdc++-v3/ChangeLog: PR libstdc++/126327 * src/c++20/string-inst.cc (basic_string::basic_string): Remove noexcept. --- diff --git a/libstdc++-v3/src/c++20/string-inst.cc b/libstdc++-v3/src/c++20/string-inst.cc index 2bdd77c78a4..b6b8d295b7c 100644 --- a/libstdc++-v3/src/c++20/string-inst.cc +++ b/libstdc++-v3/src/c++20/string-inst.cc @@ -37,7 +37,7 @@ namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION -template basic_string::basic_string() noexcept; +template basic_string::basic_string(); template bool basic_string::starts_with(string_view) const noexcept; template bool basic_string::starts_with(char) const noexcept; template bool basic_string::starts_with(const char*) const noexcept; @@ -46,7 +46,7 @@ template bool basic_string::ends_with(char) const noexcept; template bool basic_string::ends_with(const char*) const noexcept; #ifdef _GLIBCXX_USE_WCHAR_T -template basic_string::basic_string() noexcept; +template basic_string::basic_string(); template bool basic_string::starts_with(wstring_view) const noexcept; template bool basic_string::starts_with(wchar_t) const noexcept; template bool basic_string::starts_with(const wchar_t*) const noexcept;