Landing: 9082a3384ec5
Project / Subsystem
gcc / libstdc++
Date
2026-10-01
Author
Odysseas Georgoudis
Commit
9082a3384ec5b4368b28e8dc85843947b1ccdc51
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- libstdc++
- patch_id
- —
- commit_hash
- 9082a3384ec5b4368b28e8dc85843947b1ccdc51
- source_type
- github
- headline
- libstdc++: Make forward_list::sort exception-safe [PR124051]
- tldr
- Ensures std::forward_list::sort is exception-safe, preventing memory leaks or cycles on comparison exceptions.
- author
- Odysseas Georgoudis
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • libstdc++
- • exception safety
- • forward_list
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-10-01T00:00:00.000Z
The std::forward_list::sort implementation has been made exception-safe. Previously, if the comparison function threw an exception after the list’s internal pointers were rearranged, it could lead to unreachable nodes or cycles. The updated code now ensures the list is properly reconnected and all nodes remain reachable before propagating any exception.