Landing: 84ec92254bda

Project / Subsystem

gcc / c++

Date

2026-09-03

Author

Jakub Jelinek

Commit

84ec92254bda8e7675dd2b3bfd5c76255568e72e

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
c++
patch_id
—
commit_hash
84ec92254bda8e7675dd2b3bfd5c76255568e72e
source_type
github
headline
Fix constexpr structured bindings used in conditions
tldr
GCC now correctly handles constexpr structured bindings used in conditional statements, resolving a lifetime issue.
author
Jakub Jelinek
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • c++
  • • compiler
  • • consteval
discussion_id_link
—
bugzilla_pr
—
date
2026-09-03T00:00:00.000Z

This commit addresses an issue where constexpr structured bindings used as conditions in C++ code were incorrectly rejected by GCC. The compiler mistakenly flagged access to internal variables as out-of-lifetime during constant evaluation. The fix involves changing the internal representation from TARGET_EXPR to get_temp_regvar with pushdecl, which properly differentiates temporary variables from structured binding base variables.