Skip to content

Commit 0cd3f3d

Browse files
jensmaurerzygoloid
authored andcommitted
[dcl.attr.contract] Clarify evaluation of non-checked contracts
1 parent 2930dc5 commit 0cd3f3d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

source/declarations.tex

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4563,6 +4563,8 @@
45634563
A translation may be performed
45644564
with one of the following \defnx{build levels}{build level}:
45654565
\term{off}, \term{default}, or \term{audit}.
4566+
A translation with build level set to \term{off}
4567+
performs no checking for any contract.
45664568
A translation with build level set to \term{default}
45674569
performs checking for \tcode{default} contracts.
45684570
A translation with build level set to \term{audit}
@@ -4577,11 +4579,13 @@
45774579
the build level of a translation unit.
45784580

45794581
\pnum
4580-
It is unspecified whether a contract
4581-
that would not be checked under the current build level is evaluated.
4582-
If it would evaluate to \tcode{false}, the behavior is undefined.
45834582
During constant expression evaluation\iref{expr.const},
4584-
contract evaluation is performed only for those contracts that are checked.
4583+
only predicates of checked contracts are evaluated.
4584+
In other contexts,
4585+
it is unspecified whether the predicate for a contract
4586+
that is not checked under the current build level is evaluated;
4587+
if the predicate of such a contract
4588+
would evaluate to \tcode{false}, the behavior is undefined.
45854589

45864590
\pnum
45874591
The \defn{violation handler} of a program is a function of type

0 commit comments

Comments
 (0)