Skip to content

Commit 57b6a1a

Browse files
committed
CWG2549 Implicitly moving the operand of a throw-expression in unevaluated contexts
1 parent 5106ac0 commit 57b6a1a

File tree

1 file changed

+16
-20
lines changed

1 file changed

+16
-20
lines changed

source/expressions.tex

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,30 +1608,26 @@
16081608

16091609
\pnum
16101610
An \defnadj{implicitly movable}{entity} is
1611-
a variable of automatic storage duration
1611+
a variable with automatic storage duration
16121612
that is either a non-volatile object or
16131613
an rvalue reference to a non-volatile object type.
1614-
In the following contexts,
1615-
an \grammarterm{id-expression} is \defn{move-eligible}:
1614+
An \grammarterm{id-expression} is \defn{move-eligible} if
16161615
\begin{itemize}
16171616
\item
1618-
If the \grammarterm{id-expression} (possibly parenthesized)
1619-
is the operand of a \tcode{return}\iref{stmt.return} or
1620-
\keyword{co_return}\iref{stmt.return.coroutine} statement,
1621-
and names an implicitly movable entity declared in the body
1622-
or \grammarterm{parameter-declaration-clause} of the innermost enclosing
1623-
function or \grammarterm{lambda-expression}, or
1624-
\item
1625-
if the \grammarterm{id-expression} (possibly parenthesized)
1626-
is the operand of a \grammarterm{throw-expression}\iref{expr.throw},
1627-
and names an implicitly movable entity
1628-
that belongs to a scope that does not contain the \grammarterm{compound-statement}
1629-
of the innermost
1630-
\grammarterm{lambda-expression},
1631-
\grammarterm{try-block}, or
1632-
\grammarterm{function-try-block} (if any)
1633-
whose \grammarterm{compound-statement} or \grammarterm{ctor-initializer}
1634-
contains the \grammarterm{throw-expression}.
1617+
it names an implicitly movable entity,
1618+
\item
1619+
it is the (possibly parenthesized)
1620+
operand of a \tcode{return}\iref{stmt.return} or
1621+
\keyword{co_return}\iref{stmt.return.coroutine} statement or
1622+
of a \grammarterm{throw-expression}\iref{expr.throw}, and
1623+
\item
1624+
each intervening scope between
1625+
the declaration of the entity and
1626+
the innermost enclosing scope of the \grammarterm{id-expression}
1627+
is a block scope and,
1628+
for a \grammarterm{throw-expression},
1629+
is not the block scope of
1630+
a \grammarterm{try-block} or \grammarterm{function-try-block}.
16351631
\end{itemize}
16361632

16371633
\rSec3[expr.prim.id.qual]{Qualified names}

0 commit comments

Comments
 (0)