Landing: 127bd0f40827
Project / Subsystem
gcc / c++/reflection
Date
2026-08-04
Author
Marek Polacek
Commit
127bd0f40827d7472cebacd2093d3379ec25dbd7
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- c++/reflection
- patch_id
- —
- commit_hash
- 127bd0f40827d7472cebacd2093d3379ec25dbd7
- source_type
- github
- headline
- C++/reflection: Adapt to consteval-only values model for reflection.
- tldr
- GCC's reflection implementation now supports the C++ P4101 paper's 'consteval-only values' model, requiring significant internal changes.
- author
- Marek Polacek
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • c++
- • reflection
- • standardization
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-08-04T00:00:00.000Z
This commit updates GCC’s C++ reflection implementation to comply with the C++ standard paper P4101, which shifts the model from ‘consteval-only types’ to ‘consteval-only values’. This change allows for more flexibility, such as null reflections no longer being restricted to consteval contexts.
Internally, this required substantial modifications, including using LANG_TYPE instead of META_TYPE for null reflections, ensuring DW_TAG_unspecified_type in debug info, and adjusting how discarded-value expressions are handled. The changes impact expression rewriting, consteval-only value checks, and code generation, particularly for debug information.