Landing: 7d46e0676e2e

Project / Subsystem

gcc / c++

Date

2026-07-27

Author

Odysseas Georgoudis

Commit

7d46e0676e2e6b106483887ce84b8cb3042d51ea

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
c++
patch_id
—
commit_hash
7d46e0676e2e6b106483887ce84b8cb3042d51ea
source_type
github
headline
c++: Fix lambda scope cleanup after class error
tldr
Ensures correct lambda scope cleanup when a class definition fails.
author
Odysseas Georgoudis
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • c++
  • • parser
  • • lambda
discussion_id_link
—
bugzilla_pr
—
date
2026-07-27T00:00:00.000Z

When a class definition fails parsing in GCC’s C++ front-end, the lambda scope cleanup was not correctly handled, leading to incorrect active scope information. This commit modifies the parser to track whether a lambda scope was opened for a class head, ensuring proper cleanup regardless of the class definition’s success. This fixes PR125343.