]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++, contracts: Only check contracts attributes [PR116607].
authorIain Sandoe <iain@sandoe.co.uk>
Wed, 30 Oct 2024 10:29:49 +0000 (10:29 +0000)
committerIain Sandoe <iain@sandoe.co.uk>
Wed, 30 Oct 2024 13:41:57 +0000 (13:41 +0000)
commit673d6b2cbf610508d315526f4963793a343a2070
tree7e287ba2f5101d8e277b2d975e08a4dd419f3dde
parente2692b9ea7bde28de2a31a3580ce9dcc25e42fa4
c++, contracts: Only check contracts attributes [PR116607].

The ICE described in the PR is caused by not filtering out non-
contract attributes before making the has_active_contract_condition
test.  Fixed, as suggested by Andrew Pinski, by just using the
existing CONTRACT_CHAIN () macro to advance through the list.

PR c++/116607

gcc/cp/ChangeLog:

* contracts.cc (has_active_contract_condition): Use the
CONTRACT_CHAIN macro to advance through the attribute list.

gcc/testsuite/ChangeLog:

* g++.dg/contracts/pr116607.C: New test.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/cp/contracts.cc
gcc/testsuite/g++.dg/contracts/pr116607.C [new file with mode: 0644]