C++ Logo


Advanced search

Re: [wg14/wg21 liaison] [isocpp-sg21] Telecon to review P2388R1 Minimum Contract Support: either Ignore or Check_and_abort

From: Jens Maurer <Jens.Maurer_at_[hidden]>
Date: Tue, 21 Sep 2021 23:02:27 +0200
On 21/09/2021 20.54, Uecker, Martin via Liaison wrote:
> Am Dienstag, den 21.09.2021, 10:06 -0700 schrieb Ryan McDougall:
>> It should *not* be ignorable in my opinion, because ignoring runs counter
>> to the purpose of the feature
> You mean that a compiler should not be allowed to ignore it
> when in "enforcing" mode and that a compiler that does not
> support this feature should fail during compilation? Correct?

I think this "ignorable" discussion is misguided.

As far as I understand, it is explicitly desired that all
conforming implementations diagnose syntactically ill-formed
precondition / postcondition expressions.

Once that is ascertained, whether those expressions are
actually evaluated, is a different issue

(Personally, I think contracts should be a first-level
language feature that should not be hidden inside an
attribute-looking syntax atrocity. At least in C++,
the space where they are does allow for context-sensitive
keywords without much hassle; cf. override and final.)


Received on 2021-09-21 16:02:34