Skip to content

Commit 26ef49f

Browse files
committed
P3684R1 Fix erroneous behaviour termination semantics for C++26
Also fixes NB GB 02-036 (C++26 CD).
1 parent 784cc65 commit 26ef49f

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
@@ -4160,12 +4160,17 @@
41604160
\end{note}
41614161

41624162
\pnum
4163+
If any operand of a built-in operator that produces a prvalue
4164+
is evaluated,
4165+
is not a discarded-value expression\iref{expr.context}, and
4166+
produces an erroneous value,
4167+
then the value produced by that operator is erroneous.
41634168
Except in the following cases,
41644169
if an indeterminate value is produced by an evaluation,
41654170
the behavior is undefined, and
41664171
if an erroneous value is produced by an evaluation,
41674172
the behavior is erroneous and
4168-
the result of the evaluation is the value so produced but is not erroneous:
4173+
the result of the evaluation is that erroneous value:
41694174
\begin{itemize}
41704175
\item
41714176
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)