Landing: 4fd42fce8d43
Project / Subsystem
gcc / libstdc++
Date
2026-06-24
Author
Tomasz Kamiński
Commit
4fd42fce8d43cefb59c61d2865c198c35c0860be
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- libstdc++
- patch_id
- —
- commit_hash
- 4fd42fce8d43cefb59c61d2865c198c35c0860be
- source_type
- github
- headline
- libstdc++: Provide defined behavior for unrecognized _Pres_type values
- tldr
- Ensures that libstdc++'s formatting functions handle unrecognized presentation types gracefully, preventing crashes.
- author
- Tomasz Kamiński
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • libstdc++
- • formatting
- • ABI
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-06-24T00:00:00.000Z
When new _Pres_type values are introduced in std::format for future features, linking against older library versions could lead to unrecognized types. Previously, __formatter_int and __formatter_fp would trigger __builtin_unreachable in such cases, causing undefined behavior or crashes. This patch modifies these formatters to fall back to the _Pres_none behavior when an unrecognized _Pres_type is encountered, ensuring defined and safe operation.