https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114663

Ville Voutilainen <ville.voutilainen at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ville.voutilainen at gmail dot 
com

--- Comment #3 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
(4) We can have multiple failing contracts in one test, as long as
- the continuation mode is on
- all such contracts are evaluated, I mean checked.

In other words, no mixing of would-fail (axiom) contracts with ones that we
want to
test to fail.

So, the tests are bad. contract10.C has a failing axiom contract in it, but it
also tries to test checked contracts for failing. That won't work. The axiom
contract's assumption nukes the whole test.

We should test failing checked contracts by looking at the output of the run,
and
separately from that, test failing unchecked contracts by looking at the tree
output
of the compilation. And not mix the two, unless we do all testing by looking at
the
tree output. But we should never have failing unchecked contracts in tests
where
we also want to runtime-verify contract failures.

I do expect to eventually resurrect axiom contracts in a non-assumed form, and
when we do that, there should be a possibility to runtime-check them with
code that is entirely compiler-instrumented/generated. But that work is some
ways off, and in the meantime we should remove the UB from runtime tests that
attempt to runtime-test for contract failures.

Reply via email to