Landing: a310db3ba39d

Project / Subsystem

gcc / c++

Date

2026-09-04

Author

Vladislav Semykin

Commit

a310db3ba39dbf8bd4db94ee5de7acce5e1cca69

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
c++
patch_id
—
commit_hash
a310db3ba39dbf8bd4db94ee5de7acce5e1cca69
source_type
github
headline
c++: improve lambda capture of typeid expressions
tldr
Fixes a bug where generic lambdas incorrectly skipped capturing local entities in typeid expressions.
author
Vladislav Semykin
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • c++
  • • lambda
  • • typeid
  • • compiler-error
discussion_id_link
—
bugzilla_pr
—
date
2026-09-04T00:00:00.000Z

A bug in C++ lambda capture has been fixed, resolving an ICE that occurred when generic lambdas interacted with typeid expressions. Previously, the compiler could incorrectly skip capturing local entities required by the C++ standard when evaluating typeid. This change modifies how the compiler determines if a typeid expression necessitates a capture, ensuring correct behavior even within template contexts and for complex nested typeid expressions. A new mechanism, cp_unevaluated_typeid_cutoff, is introduced to manage this evaluation process.