Landing: 83a903f339af
Project / Subsystem
gcc / c++
Date
2026-07-21
Author
Marek Polacek
Commit
83a903f339af9a1ecde675261191cc69e7b1b721
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- c++
- patch_id
- —
- commit_hash
- 83a903f339af9a1ecde675261191cc69e7b1b721
- source_type
- github
- headline
- C++: Implement LWG 3819 for references from temporaries.
- tldr
- C++ standard library type traits now correctly handle references constructed from prvalue temporaries, fixing a niche corner case.
- author
- Marek Polacek
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • c++
- • language
- • type traits
- • standard
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-07-21T00:00:00.000Z
This commit implements C++ Language Working Group (LWG) issue 3819, improving how type traits handle references constructed from temporary objects. Previously, the compiler incorrectly determined that a const T& could not be constructed from a prvalue U if T had a deleted move constructor, even though the move operation should be elided. A new function build_prvalue_trait_object is introduced to address this by correctly generating a prvalue for trait evaluations.