Landing: 960e68941db7

Project / Subsystem

gcc / c++

Date

2026-05-21

Author

Jakub Jelinek

Commit

960e68941db7412cfdfb429161d77db206a06acc

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
c++
patch_id
commit_hash
960e68941db7412cfdfb429161d77db206a06acc
source_type
github
headline
Fixes name handling in coroutine lowering for C++26.
tldr
Fixes a miscompilation in C++26 coroutines by ensuring unique names for compiler-generated variables, avoiding conflicts when multiple unnamed variables exist…
author
Jakub Jelinek
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • c++
  • coroutines
  • bugfix
discussion_id_link
bugzilla_pr
date
2026-05-21T00:00:00.000Z

In C++26, multiple unnamed variables (’_’) can exist in the same scope within a coroutine. The compiler was incorrectly using the same field declaration multiple times for these variables, leading to miscompilation. This commit fixes the issue by ensuring that compiler-generated variables have unique names, even when the source code doesn’t provide them explicitly. Specifically, it makes the compiler pretend such variables don’t have a name, so it uses a serial number then instead.