Skip to content

[std] Use $E$ as expression placeholder. #3554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 4, 2020
Merged
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
58 changes: 29 additions & 29 deletions source/basic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -300,38 +300,38 @@
an unevaluated operand\iref{expr.prop},
a subexpression thereof, or
a conversion in an initialization or conversion sequence in such a context.
The set of \defn{potential results} of an expression \tcode{e} is
The set of \defn{potential results} of an expression $E$ is
defined as follows:
\begin{itemize}
\item If \tcode{e} is an
\item If $E$ is an
\grammarterm{id-expression}\iref{expr.prim.id}, the set
contains only \tcode{e}.
\item If \tcode{e} is a subscripting operation\iref{expr.sub} with
contains only $E$.
\item If $E$ is a subscripting operation\iref{expr.sub} with
an array operand, the set contains the potential results of that operand.
\item If \tcode{e} is a class member access
\item If $E$ is a class member access
expression\iref{expr.ref} of the form
\tcode{e1 . \opt{template} e2}
\tcode{$E_1$ . \opt{template} $E_2$}
naming a non-static data member,
the set contains the potential results of \tcode{e1}.
\item If \tcode{e} is a class member access expression
the set contains the potential results of $E_1$.
\item If $E$ is a class member access expression
naming a static data member,
the set contains the \grammarterm{id-expression} designating the data member.
\item If \tcode{e} is a pointer-to-member
\item If $E$ is a pointer-to-member
expression\iref{expr.mptr.oper} of the form
\tcode{e1 .* e2},
the set contains the potential results of \tcode{e1}.
\item If \tcode{e} has the form \tcode{(e1)}, the set contains the
potential results of \tcode{e1}.
\item If \tcode{e} is a glvalue conditional
\tcode{$E_1$ .* $E_2$},
the set contains the potential results of $E_1$.
\item If $E$ has the form \tcode{($E_1$)}, the set contains the
potential results of $E_1$.
\item If $E$ is a glvalue conditional
expression\iref{expr.cond}, the set is the union of the sets of
potential results of the second and third operands.
\item If \tcode{e} is a comma expression\iref{expr.comma}, the set
\item If $E$ is a comma expression\iref{expr.comma}, the set
contains the potential results of the right operand.
\item Otherwise, the set is empty.
\end{itemize}
\begin{note}
This set is a (possibly-empty) set of \grammarterm{id-expression}{s},
each of which is either \tcode{e} or a subexpression of \tcode{e}.
each of which is either $E$ or a subexpression of $E$.
\begin{example}
In the following example, the set of potential results of the initializer
of \tcode{n} contains the first \tcode{S::x} subexpression, but not the second
Expand Down Expand Up @@ -386,21 +386,21 @@

\pnum
A variable \tcode{x} whose name appears as a
potentially-evaluated expression \tcode{e}
is \defnx{odr-used}{odr-use} by \tcode{e} unless
potentially-evaluated expression $E$
is \defnx{odr-used}{odr-use} by $E$ unless
\begin{itemize}
\item
\tcode{x} is a reference that is
usable in constant expressions\iref{expr.const}, or
\item
\tcode{x} is a variable of non-reference type that is
usable in constant expressions and has no mutable subobjects, and
\tcode{e} is an element of the set of potential results of an expression
$E$ is an element of the set of potential results of an expression
of non-volatile-qualified non-class type
to which the lvalue-to-rvalue conversion\iref{conv.lval} is applied, or
\item
\tcode{x} is a variable of non-reference type, and
\tcode{e} is an element of the set of potential results
$E$ is an element of the set of potential results
of a discarded-value expression\iref{expr.prop}
to which the lvalue-to-rvalue conversion is not applied.
\end{itemize}
Expand Down Expand Up @@ -5278,30 +5278,30 @@
\end{example}

\pnum
The \defnx{immediate subexpressions}{immediate subexpression} of an expression \tcode{e} are
The \defnx{immediate subexpressions}{immediate subexpression} of an expression $E$ are
\begin{itemize}
\item
the constituent expressions of \tcode{e}'s operands\iref{expr.prop},
the constituent expressions of $E$'s operands\iref{expr.prop},
\item
any function call that \tcode{e} implicitly invokes,
any function call that $E$ implicitly invokes,
\item
if \tcode{e} is a \grammarterm{lambda-expression}\iref{expr.prim.lambda},
if $E$ is a \grammarterm{lambda-expression}\iref{expr.prim.lambda},
the initialization of the entities captured by copy and
the constituent expressions of the \grammarterm{initializer} of the \grammarterm{init-capture}{s},
\item
if \tcode{e} is a function call\iref{expr.call} or implicitly invokes a function,
if $E$ is a function call\iref{expr.call} or implicitly invokes a function,
the constituent expressions of each default argument\iref{dcl.fct.default}
used in the call, or
\item
if \tcode{e} creates an aggregate object\iref{dcl.init.aggr},
if $E$ creates an aggregate object\iref{dcl.init.aggr},
the constituent expressions of each default member initializer\iref{class.mem}
used in the initialization.
\end{itemize}

\pnum
A \defn{subexpression} of an expression \tcode{e} is
an immediate subexpression of \tcode{e} or
a subexpression of an immediate subexpression of \tcode{e}.
A \defn{subexpression} of an expression $E$ is
an immediate subexpression of $E$ or
a subexpression of an immediate subexpression of $E$.
\begin{note}
Expressions appearing in the \grammarterm{compound-statement} of a \grammarterm{lambda-expression}
are not subexpressions of the \grammarterm{lambda-expression}.
Expand Down
48 changes: 24 additions & 24 deletions source/declarations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1554,35 +1554,35 @@

\pnum
\indextext{type specifier!\idxcode{decltype}}%
For an expression \tcode{e}, the type denoted by \tcode{decltype(e)} is defined as follows:
For an expression $E$, the type denoted by \tcode{decltype($E$)} is defined as follows:
\begin{itemize}
\item if \tcode{e} is an unparenthesized \grammarterm{id-expression}
\item if $E$ is an unparenthesized \grammarterm{id-expression}
naming a structured binding\iref{dcl.struct.bind},
\tcode{decltype(e)} is the referenced type as given in
\tcode{decltype($E$)} is the referenced type as given in
the specification of the structured binding declaration;

\item otherwise, if \tcode{e} is an unparenthesized \grammarterm{id-expression}
\item otherwise, if $E$ is an unparenthesized \grammarterm{id-expression}
naming a non-type \grammarterm{template-parameter}\iref{temp.param},
\tcode{decltype(e)} is the type of the \grammarterm{template-parameter}
\tcode{decltype($E$)} is the type of the \grammarterm{template-parameter}
after performing any necessary type deduction
(\ref{dcl.spec.auto}, \ref{dcl.type.class.deduct});

\item otherwise, if \tcode{e} is an unparenthesized \grammarterm{id-expression} or
\item otherwise, if $E$ is an unparenthesized \grammarterm{id-expression} or
an unparenthesized
class
member access\iref{expr.ref}, \tcode{decltype(e)} is the
type of the entity named by \tcode{e}. If there is no such entity, or
if \tcode{e} names a set of overloaded functions, the program is
member access\iref{expr.ref}, \tcode{decltype($E$)} is the
type of the entity named by $E$. If there is no such entity, or
if $E$ names a set of overloaded functions, the program is
ill-formed;

\item otherwise, if \tcode{e} is
an xvalue, \tcode{decltype(e)} is \tcode{T\&\&}, where \tcode{T} is the type
of \tcode{e};
\item otherwise, if $E$ is
an xvalue, \tcode{decltype($E$)} is \tcode{T\&\&}, where \tcode{T} is the type
of $E$;

\item otherwise, if \tcode{e} is an lvalue, \tcode{decltype(e)}
is \tcode{T\&}, where \tcode{T} is the type of \tcode{e};
\item otherwise, if $E$ is an lvalue, \tcode{decltype($E$)}
is \tcode{T\&}, where \tcode{T} is the type of $E$;

\item otherwise, \tcode{decltype(e)} is the type of \tcode{e}.
\item otherwise, \tcode{decltype($E$)} is the type of $E$.
\end{itemize}

The operand of the \tcode{decltype} specifier is an unevaluated
Expand Down Expand Up @@ -1900,32 +1900,32 @@

\pnum
A type \tcode{T} containing a placeholder type,
and a corresponding initializer \tcode{e},
and a corresponding initializer $E$,
are determined as follows:
\begin{itemize}
\item
for a non-discarded \tcode{return} statement that occurs
in a function declared with a return type
that contains a placeholder type,
\tcode{T} is the declared return type
and \tcode{e} is the operand of the \tcode{return} statement.
and $E$ is the operand of the \tcode{return} statement.
If the \tcode{return} statement
has no operand,
then \tcode{e} is \tcode{void()};
then $E$ is \tcode{void()};
\item
for a variable declared with a type
that contains a placeholder type,
\tcode{T} is the declared type of the variable
and \tcode{e} is the initializer.
and $E$ is the initializer.
If the initialization is direct-list-initialization,
the initializer shall be a \grammarterm{braced-init-list}
containing only a single \grammarterm{assignment-expression}
and \tcode{e} is the \grammarterm{assignment-expression};
and $E$ is the \grammarterm{assignment-expression};
\item
for a non-type template parameter declared with a type
that contains a placeholder type,
\tcode{T} is the declared type of the non-type template parameter
and \tcode{e} is the corresponding template argument.
and $E$ is the corresponding template argument.
\end{itemize}

In the case of a \tcode{return} statement with no operand
Expand All @@ -1936,7 +1936,7 @@

\pnum
If the deduction is for a \tcode{return} statement
and \tcode{e} is a \grammarterm{braced-init-list}\iref{dcl.init.list},
and $E$ is a \grammarterm{braced-init-list}\iref{dcl.init.list},
the program is ill-formed.

\pnum
Expand All @@ -1954,7 +1954,7 @@
of template argument deduction from a function call\iref{temp.deduct.call},
where \tcode{P} is a
function template parameter type and
the corresponding argument is \tcode{e}.
the corresponding argument is $E$.
If the deduction fails, the declaration is ill-formed.
Otherwise, $\mathtt{T}'$ is obtained by
substituting the deduced \tcode{U} into \tcode{P}.
Expand Down Expand Up @@ -1985,7 +1985,7 @@
\tcode{T} shall be the
placeholder alone. The type deduced for \tcode{T} is
determined as described in~\ref{dcl.type.simple}, as though
\tcode{e} had
$E$ had
been the operand of the \tcode{decltype}.
\begin{example}
\begin{codeblock}
Expand Down
16 changes: 8 additions & 8 deletions source/exceptions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -817,40 +817,40 @@
\end{example}

\pnum
An expression \tcode{e} is
An expression $E$ is
\defnx{potentially-throwing}{potentially-throwing!expression} if
\begin{itemize}
\item
\tcode{e} is a function call\iref{expr.call}
$E$ is a function call\iref{expr.call}
whose \grammarterm{postfix-expression}
has a function type,
or a pointer-to-function type,
with a potentially-throwing exception specification,
or
\item
\tcode{e} implicitly invokes a function
$E$ implicitly invokes a function
(such as an overloaded operator,
an allocation function in a \grammarterm{new-expression},
a constructor for a function argument,
or a destructor if \tcode{e} is a full-expression\iref{intro.execution})
or a destructor if $E$ is a full-expression\iref{intro.execution})
that is potentially-throwing,
or
\item
\tcode{e} is a \grammarterm{throw-expression}\iref{expr.throw},
$E$ is a \grammarterm{throw-expression}\iref{expr.throw},
or
\item
\tcode{e} is a \tcode{dynamic_cast} expression that casts to a reference type and
$E$ is a \tcode{dynamic_cast} expression that casts to a reference type and
requires a runtime check\iref{expr.dynamic.cast},
or
\item
\tcode{e} is a \tcode{typeid} expression applied to a
$E$ is a \tcode{typeid} expression applied to a
(possibly parenthesized) built-in unary \tcode{*} operator
applied to a pointer to a
polymorphic class type\iref{expr.typeid},
or
\item
any of the immediate subexpressions\iref{intro.execution}
of \tcode{e} is potentially-throwing.
of $E$ is potentially-throwing.
\end{itemize}

\pnum
Expand Down
Loading