Landing: 396ad1175450
Project / Subsystem
gcc / libstdc++
Date
2026-05-19
Author
Jonathan Wakely
Commit
396ad1175450c22098a59a0e033dcdd5fc19b2ff
Source
github
Perf win
Yes
Breaking
No
All attributes
- project
- gcc
- subsystem
- libstdc++
- patch_id
- —
- commit_hash
- 396ad1175450c22098a59a0e033dcdd5fc19b2ff
- source_type
- github
- headline
- Libstdc++: Split <iosfwd> and only include it in <ios> [PR125371]
- tldr
- Splits `<iosfwd>` into smaller headers and includes them selectively to avoid unnecessary forward declarations and improve compiler fix-it hints.
- author
- Jonathan Wakely
- outcome
- committed
- performance_win
- true
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • libstdc++
- • iostream
- • header
- • fixit
- • forward declaration
- discussion_id_link
- github:gcc-mirror/gcc#125371
- bugzilla_pr
- —
- date
- 2026-05-19T00:00:00.000Z
This commit addresses PR125371 by splitting the <iosfwd> header into smaller, more specific headers. It then includes these smaller headers only where needed, instead of including the entire <iosfwd> in headers like <istream> and <ostream>. This reduces the number of unnecessary forward declarations, which improves the accuracy of compiler fix-it hints for undeclared types and provides a better user experience when working with iostreams.