Landing: 3bd34f8936c7

Project / Subsystem

gcc / c++/contracts

Date

2026-09-20

Author

Joshua Berne

Commit

3bd34f8936c7edb25d35bc2816a863ca902938bf

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
c++/contracts
patch_id
—
commit_hash
3bd34f8936c7edb25d35bc2816a863ca902938bf
source_type
github
headline
Fix handling of `__contract_assert` extension in C++ contracts.
tldr
Ensures the GCC-specific `__contract_assert` keyword is correctly parsed and handled for contract assertions.
author
Joshua Berne
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • c++
  • • contracts
  • • bugfix
  • • parser
discussion_id_link
—
bugzilla_pr
—
date
2026-09-20T00:00:00.000Z

This commit corrects the parsing of the GCC-specific __contract_assert keyword used in C++26 contracts. Previously, the compiler incorrectly relied on string matching for contract_assert, failing to recognize the extended spelling. The fix identifies assertion statements by their parsed token rather than a raw string, ensuring both contract_assert and __contract_assert are treated as reserved identifiers.