Landing: d7a18fca936d

Project / Subsystem

gcc / c++/contracts

Date

2026-08-14

Author

Wang Jinghao

Commit

d7a18fca936d64d8c6e7ef7c535e2cfc6665aa8d

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
c++/contracts
patch_id
—
commit_hash
d7a18fca936d64d8c6e7ef7c535e2cfc6665aa8d
source_type
github
headline
C++ contracts handle parameter pack expansions correctly.
tldr
Fixes C++26 contract conditions with parameter pack expansions to correctly use local specializations.
author
Wang Jinghao
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • c++
  • • contracts
  • • templates
discussion_id_link
—
bugzilla_pr
—
date
2026-08-14T00:00:00.000Z

This commit addresses an issue in C++26 contract conditions where parameter pack expansions were not correctly using local specializations. Previously, the at_function_scope_p() check incorrectly returned false when parameter pack expansions were formed in contract conditions, leading to improper substitution. The fix involves using local_bindings_p and reordering scope kinds to ensure parameter packs are handled correctly within contract conditions, aligning their behavior with that inside a function body.