Landing: ac1cdcdad9d3

Project / Subsystem

gcc / gcc

Date

2026-04-30

Author

yxj-github-437

Commit

ac1cdcdad9d364f239d075deb7082071c49ddb6d

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
gcc
patch_id
commit_hash
ac1cdcdad9d364f239d075deb7082071c49ddb6d
source_type
github
headline
C++ Contracts: Fix testsuite failure due to incorrect caching.
tldr
Prevents caching of constexpr function results when contract violations occur, fixing a testsuite failure.
author
yxj-github-437
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • c++
  • contracts
  • constexpr
  • compiler
  • bugfix
discussion_id_link
bugzilla_pr
date
2026-04-30T00:00:00.000Z

The compiler was incorrectly caching the results of constexpr functions even when contract violations occurred. This commit prevents caching of results with contract violations in constexpr_call, which fixes a testsuite failure in basic.contract.eval.p8. This ensures that contract violations are not masked by cached results.