]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++, contracts: Abstract interfaces to constexpr [NFC].
authorIain Sandoe <iain@sandoe.co.uk>
Wed, 17 Sep 2025 15:28:41 +0000 (16:28 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Wed, 1 Oct 2025 21:38:59 +0000 (22:38 +0100)
commitf2d9f6635e33ddcc1999fceb1b025635e1b646f9
tree72392e0823243c1a0b42556c4eaf80188ddf771b
parentc866a8a88242833f64fe25e04e4ad4c097daec34
c++, contracts: Abstract interfaces to constexpr [NFC].

We want to move to having different representations of the contract
semantic for C++26, since that wants values outside the range that
can be accommodated using the cxx2a mechanisms.  First part, abstract
the interfaces to constexpr, so that they do not see the underlying
source of data.

gcc/cp/ChangeLog:

* constexpr.cc (cxx_eval_constant_expression): Use revised
interfaces to determine if contracts are ignored and, if not,
whether they are evaluated.
* contracts.h (contract_ignored_p, contract_evaluated_p): New.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/cp/constexpr.cc
gcc/cp/contracts.h