Landing: 4e2b29c333fc

Project / Subsystem

gcc / libstdc++

Date

2026-07-22

Author

Nathan Blackburn

Commit

4e2b29c333fcbead93b2911326cff4218d3c155c

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
libstdc++
patch_id
commit_hash
4e2b29c333fcbead93b2911326cff4218d3c155c
source_type
github
headline
Libstdc++: Remove noexcept from basic_string instantiations.
tldr
Unconditional noexcept is removed from basic_string's default constructor instantiations, as it can throw.
author
Nathan Blackburn
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • libstdc++
  • string
  • noexcept
  • conformance
discussion_id_link
bugzilla_pr
date
2026-07-22T00:00:00.000Z

Explicit instantiations of std::basic_string’s default constructor in libstdc++ incorrectly declared themselves as noexcept. This commit removes the unconditional noexcept specification from both char and wchar_t instantiations, as the default constructor for the fully-dynamic COW (Copy-On-Write) string implementation can, in fact, throw exceptions. This resolves a conformance issue.