Landing: 44c5485dac70

Project / Subsystem

gcc / c++

Date

2026-04-20

Author

Andrew Pinski

Commit

44c5485dac70d7f0d62e880b1162d49805404ed8

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
c++
patch_id
commit_hash
44c5485dac70d7f0d62e880b1162d49805404ed8
source_type
github
headline
C++: Fix handling of && after a class definition.
tldr
The compiler now correctly parses rvalue references (&&) immediately following a class definition, fixing a regression.
author
Andrew Pinski
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • c++
  • parser
  • rvalue reference
  • syntax
discussion_id_link
bugzilla_pr
date
2026-04-20T00:00:00.000Z

A recent change caused the compiler to incorrectly reject rvalue references (&&) immediately after a class definition (e.g., struct {} && m = {};). This commit corrects the parser to allow && in this context, similar to how :: is handled. This fixes a regression introduced by an earlier change and restores correct parsing of C++ code.