Landing: 78b03e229672

Project / Subsystem

gcc / c++/reflection

Date

2026-08-03

Author

Marek Polacek

Commit

78b03e2296722df3b69f28677cbeed03c1642dbf

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
c++/reflection
patch_id
—
commit_hash
78b03e2296722df3b69f28677cbeed03c1642dbf
source_type
github
headline
Allow C++ reflection of pack-index-specifiers
tldr
Corrects C++ reflection to allow `^^` with type pack expansion specifiers.
author
Marek Polacek
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • c++
  • • reflection
  • • template
  • • compiler bug
discussion_id_link
—
bugzilla_pr
—
date
2026-08-03T00:00:00.000Z

This commit corrects the C++ reflection mechanism to properly handle pack-index-specifiers with the ^^ (reflection) operator. The C++ standard specifies that reflections of pack-index-expressions are ill-formed, but this restriction does not apply to pack-index-specifiers when used with types. The GCC compiler previously incorrectly rejected pack-index-specifiers in this context. This change modifies the get_reflection function to distinguish between pack-index-expressions and pack-index-specifiers, allowing the latter to be reflected and fixing a bug reported in PR126546.