https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116607
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Iain D Sandoe <ia...@gcc.gnu.org>: https://gcc.gnu.org/g:673d6b2cbf610508d315526f4963793a343a2070 commit r15-4778-g673d6b2cbf610508d315526f4963793a343a2070 Author: Iain Sandoe <i...@sandoe.co.uk> Date: Wed Oct 30 10:29:49 2024 +0000 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 <i...@sandoe.co.uk>