[Bug target/126327] [17 regression] Build fails for *-w64-mingw32 due to exception specification mismatch
"redi at gcc dot gnu.org via Gcc-bugs" <[email protected]>
| Newsgroups | gmane.comp.gcc.bugs |
|---|---|
| Message-ID | <[email protected]/bugzilla/> |
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126327
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2026-07-22
Keywords| |patch
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Nathan Blackburn from comment #2)
> I will submit the patch to fix this bug.
>
> It has been fixed by only specifying noexcept when
> _GLIBCXX_FULLY_DYNAMIC_STRING is zero, for both the char and wchar_t
> instantiations:
>
> template basic_string<char>::basic_string()
> #if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
> _GLIBCXX_NOEXCEPT
> #endif
> ;
That would be wrong. The SSO string is always noexcept, it has nothing to do
with _GLIBCXX_FULLY_DYNAMIC_STRING.
The problem only occurs when string-inst.cc is included in cow-string-inst.cc,
not when string-inst.cc is compiled standalone.
The correct fix is as Marek suggested, and as you proposed in
https://gcc.gnu.org/pipermail/gcc-patches/2026-July/725021.html