Landing: 6d035aa99c3d
Project / Subsystem
gcc / c++/reflection
Date
2026-04-21
Author
Marek Polacek
Commit
6d035aa99c3d1197167e085302d8ce015b950b35
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- c++/reflection
- patch_id
- —
- commit_hash
- 6d035aa99c3d1197167e085302d8ce015b950b35
- source_type
- github
- headline
- c++/reflection: Fix error with ODR-used inline consteval variables.
- tldr
- The compiler now correctly handles ODR-used inline variables of consteval-only types by checking for DECL_INITIAL.
- author
- Marek Polacek
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • c++
- • reflection
- • bugfix
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-04-21T00:00:00.000Z
The compiler was incorrectly issuing an error for ODR-used inline variables of consteval-only types. The fix strengthens the check in wrapup_namespace_globals to also verify that !DECL_INITIAL is true before issuing the error. This ensures that variables with definitions are not erroneously flagged as missing definitions.