]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Remove noexcept from basic_string instantiations [PR126327] master trunk
authorNathan Blackburn <nathan.blackburn@arm.com>
Wed, 22 Jul 2026 16:48:38 +0000 (16:48 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 23 Jul 2026 10:22:24 +0000 (11:22 +0100)
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.

libstdc++-v3/src/c++20/string-inst.cc

index 2bdd77c78a4f76c623c0e3ce88d08be872635e6d..b6b8d295b7cf9b4af2b00aed733da385f7da2fc0 100644 (file)
@@ -37,7 +37,7 @@
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
-template basic_string<char>::basic_string() noexcept;
+template basic_string<char>::basic_string();
 template bool basic_string<char>::starts_with(string_view) const noexcept;
 template bool basic_string<char>::starts_with(char) const noexcept;
 template bool basic_string<char>::starts_with(const char*) const noexcept;
@@ -46,7 +46,7 @@ template bool basic_string<char>::ends_with(char) const noexcept;
 template bool basic_string<char>::ends_with(const char*) const noexcept;
 
 #ifdef _GLIBCXX_USE_WCHAR_T
-template basic_string<wchar_t>::basic_string() noexcept;
+template basic_string<wchar_t>::basic_string();
 template bool basic_string<wchar_t>::starts_with(wstring_view) const noexcept;
 template bool basic_string<wchar_t>::starts_with(wchar_t) const noexcept;
 template bool basic_string<wchar_t>::starts_with(const wchar_t*) const noexcept;