Landing: b3bca9f73eb6

Project / Subsystem

gcc / c++

Date

2026-08-14

Author

Patrick Palka

Commit

b3bca9f73eb6b29bddf5fec92e929f32675b8d20

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
c++
patch_id
—
commit_hash
b3bca9f73eb6b29bddf5fec92e929f32675b8d20
source_type
github
headline
Fix C++ constant evaluation in lambda scopes for PR126483.
tldr
C++ compiler now correctly handles constexpr evaluation within lambda scopes for PR126483.
author
Patrick Palka
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • c++
  • • constexpr
  • • lambda
discussion_id_link
—
bugzilla_pr
—
date
2026-08-14T00:00:00.000Z

This change corrects an issue where the C++ compiler prematurely folded initializers within lambda scopes, leading to incorrect is_constant_evaluated results. The fix involves using maybe_constexpr_fn instead of DECL_DECLARED_CONSTEXPR_P to determine if a lambda scope is constexpr-suitable, ensuring correct constant evaluation behavior.