c++: small contracts fixes
authorJason Merrill <jason@redhat.com>
Wed, 30 Nov 2022 19:22:03 +0000 (14:22 -0500)
committerJason Merrill <jason@redhat.com>
Thu, 1 Dec 2022 03:46:05 +0000 (22:46 -0500)
commit4304e09a1617bcf1c87f5bc96017ae5017379d75
treeea3d7c8715a87b686240adfa369ba853ed536653
parentcda29c540037fbcf00a377196050953aab1d3d5b
c++: small contracts fixes

The first is an actual bug: remove_contract_attributes was only keeping one
attribute.  The second just helps flow analysis in optimizers and static
analyzers.

gcc/cp/ChangeLog:

* contracts.cc (remove_contract_attributes): Actually prepend
to the list.
* pt.cc (tsubst_contract): Only look for a postcondition if type is
nonnull.
gcc/cp/contracts.cc
gcc/cp/pt.cc