Landing: 8fb57eda04f8

Project / Subsystem

gcc / c++/reflection

Date

2026-07-31

Author

Marek Polacek

Commit

8fb57eda04f88f4e0d1cbbcc209533fd9689dd9d

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
c++/reflection
patch_id
—
commit_hash
8fb57eda04f88f4e0d1cbbcc209533fd9689dd9d
source_type
github
headline
Fix ICE with '&template [:members_of():]' in reflection
tldr
Resolves a compiler internal error when using C++ reflection with template members.
author
Marek Polacek
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • c++
  • • reflection
  • • compiler error
  • • template
discussion_id_link
—
bugzilla_pr
—
date
2026-07-31T00:00:00.000Z

This commit fixes an internal compiler error (ICE) that occurred when using C++ reflection with expressions like &template [:members_of():]. The issue stemmed from incorrect handling of overloaded function templates within the reflection parsing logic. The compiler failed to correctly wrap template declarations in an OVERLOAD set and apply necessary context like BASELINK. This change ensures that both OVERLOAD and BASELINK are appropriately applied, resolving the ICE and improving the robustness of C++ reflection.