Landing: 50a2eb56b9a3

Project / Subsystem

gcc / c++/reflection

Date

2026-08-17

Author

Marek Polacek

Commit

50a2eb56b9a350ecced4db4942e92d463dab8d8f

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
c++/reflection
patch_id
—
commit_hash
50a2eb56b9a350ecced4db4942e92d463dab8d8f
source_type
github
headline
c++/reflection: reject bare [: bases_of(...)[0] :]
tldr
Correctly rejects ill-formed reflection expressions involving base class relationships without an object.
author
Marek Polacek
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • c++
  • • reflection
  • • language feature
discussion_id_link
—
bugzilla_pr
—
date
2026-08-17T00:00:00.000Z

This change rejects C++ reflection expressions that attempt to splice a base class relationship without specifying an object. The standard implies such expressions, which reference a direct base class relationship, require an object context, and this commit enforces that rule to prevent crashes in the compiler’s gimplify phase.