Landing: eb54aa2d961e
Project / Subsystem
gcc / c++
Date
2026-07-24
Author
Odysseas Georgoudis
Commit
eb54aa2d961ec016d15bd39ea62579af4ad25710
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- c++
- patch_id
- —
- commit_hash
- eb54aa2d961ec016d15bd39ea62579af4ad25710
- source_type
- github
- headline
- C++ constexpr virtual call results adjusted for covariant overrides
- tldr
- Fixes ICE in constexpr evaluation of covariant virtual calls by correctly handling return types.
- author
- Odysseas Georgoudis
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • c++
- • constexpr
- • optimization
- • compiler bug
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-07-24T00:00:00.000Z
Constant evaluation of C++ virtual calls, especially with covariant return types, could lead to internal compiler errors (ICEs) due to type mismatches. This fix ensures that the result of a constexpr virtual call, including those involving result thunks for covariant overrides, is correctly adjusted to the static type of the call before being used in subsequent expressions, preventing the ICE.