Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions source/expressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -8298,8 +8298,7 @@
assuming that copy elision\iref{class.copy.elision} is not performed,
are called constant expressions.
\begin{note}
Constant expressions can be evaluated
during translation.
Certain constant expressions are evaluated during translation\iref{lex.phases}.
\end{note}

\pnum
Expand Down Expand Up @@ -9010,12 +9009,13 @@
with all contract assertions
using the ignore evaluation semantic\iref{basic.contract.eval},
\begin{note}
Within this evaluation,
In the course of this determination,
\tcode{std::is_constant_evaluated()}\iref{meta.const.eval}
returns \keyword{true}.
has the value \keyword{true}.
\end{note}
\begin{note}
The initialization, when evaluated,
Furthermore, if the initialization is manifestly constant-evaluated,
its evaluation during translation
can still evaluate contract assertions
with other evaluation semantics,
resulting in a diagnostic or ill-formed program
Expand Down Expand Up @@ -9415,6 +9415,8 @@
\begin{itemize}
\item a \grammarterm{constant-expression}, or
\item the condition of a constexpr if statement\iref{stmt.if}, or
\item the expression corresponding to
a \grammarterm{consteval-block-declaration}\iref{dcl.pre}, or
\item an immediate invocation, or
\item the result of substitution into an atomic constraint expression
to determine whether it is satisfied\iref{temp.constr.atomic}, or
Expand All @@ -9423,7 +9425,7 @@
has constant initialization\iref{basic.start.static}.
\begin{footnote}
Testing this condition
can involve a trial evaluation of its initializer,
can involve a notional evaluation of its initializer,
with evaluations of contract assertions
using the ignore evaluation semantic\iref{basic.contract.eval},
as described above.
Expand Down
15 changes: 9 additions & 6 deletions source/lex.tex
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,14 @@
that it be instantiated at an earlier point\iref{temp.inst}.
\end{note}

Each instantiation results in new program constructs.
The program is ill-formed if any instantiation fails.

During the analysis and translation of tokens,
certain expressions are evaluated\iref{expr.const}.
each manifestly constant-evaluated expression is evaluated\iref{expr.const}.
The values of these expressions affect
the types named and reflection values used in the program and
thus the syntactic analysis.
Their evaluation also can produce side effects that affect that analysis.
Constructs appearing at a program point $P$ are analyzed
in a context where each side effect of evaluating an expression $E$
as a full-expression is complete if and only if
Expand Down Expand Up @@ -261,19 +264,19 @@
void fn() {
/* @$p_1$@ */ Incomplete i; // OK
}
}; /* @$p_2$@ */
} /* @$p_2$@ */ ;

consteval {
define_aggregate(^^Incomplete, {});
}
}; /* @$p_3$@ */
} /* @$p_3$@ */ ;
\end{codeblock}
Constructs at $p_1$ are analyzed in a context
where the side effect of the call to \tcode{define_aggregate} is evaluated
where the side effect of the call to \tcode{define_aggregate} is complete
because
\begin{itemize}
\item
$E$ is the expression corresponding to a consteval block, and
the call appears in a consteval block, and
\item
$p_1$ is in a complete-class context of \tcode{S} and
the consteval block is reachable from $p_3$.
Expand Down
Loading