Landing: 621661f7d2e9

Project / Subsystem

gcc / c++

Date

2026-07-07

Author

Vladislav Semykin

Commit

621661f7d2e9157b7e5d55fc493e1b6956a35aac

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
c++
patch_id
commit_hash
621661f7d2e9157b7e5d55fc493e1b6956a35aac
source_type
github
headline
C++: Fix typeid operand evaluation context [PR125886]
tldr
Ensures `typeid` operands are correctly evaluated only when necessary, fixing parser and diagnostic issues.
author
Vladislav Semykin
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • c++
  • parser
  • compiler diagnostics
  • standard conformance
discussion_id_link
bugzilla_pr
date
2026-07-07T00:00:00.000Z

This commit rectifies how GCC handles typeid operand evaluation, ensuring operands are treated as unevaluated by default as per the C++ standard. Previously, GCC always parsed typeid operands in an evaluated context, causing issues with constructs like declval, non-static data members, and function parameters, and missing lambda capture diagnostics. A two-pass parsing approach is implemented to resolve this.