Skip to content

Commit 01bb4b4

Browse files
jensmaurertkoeppe
authored andcommitted
P3684R1 Fix erroneous behaviour termination semantics for C++26
Also fixes NB GB 02-036 (C++26 CD).
1 parent 6cdd68b commit 01bb4b4

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

source/basic.tex

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4179,12 +4179,17 @@
41794179
\end{note}
41804180

41814181
\pnum
4182+
If any operand of a built-in operator that produces a prvalue
4183+
is evaluated,
4184+
is not a discarded-value expression\iref{expr.context}, and
4185+
produces an erroneous value,
4186+
then the value produced by that operator is erroneous.
41824187
Except in the following cases,
41834188
if an indeterminate value is produced by an evaluation,
41844189
the behavior is undefined, and
41854190
if an erroneous value is produced by an evaluation,
41864191
the behavior is erroneous and
4187-
the result of the evaluation is the value so produced but is not erroneous:
4192+
the result of the evaluation is that erroneous value:
41884193
\begin{itemize}
41894194
\item
41904195
If an indeterminate or erroneous value of

source/intro.tex

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -986,10 +986,9 @@
986986
If the selected execution contains an undefined operation,
987987
the implementation executing that program with that input
988988
may produce arbitrary additional observable behavior afterwards.
989-
If the execution contains an operation specified as having erroneous behavior,
989+
If the execution of an operation is specified as having erroneous behavior,
990990
the implementation is permitted to issue a diagnostic and
991-
is permitted to terminate the execution
992-
at an unspecified time after that operation.
991+
is permitted to terminate the execution of the program.
993992

994993
\pnum
995994
\recommended

0 commit comments

Comments
 (0)