Skip to content

[stmt.return], [stmt.return.coroutine] update notes re implicit move #5783

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
10 changes: 7 additions & 3 deletions source/statements.tex
Original file line number Diff line number Diff line change
Expand Up @@ -900,10 +900,10 @@
\end{note}
\begin{note}
A \tcode{return} statement can involve
an invocation of a constructor to perform a copy or move of the operand
a copy or move of the operand
if it is not a prvalue or if its type differs from the return type of the function.
A copy operation associated with a \tcode{return} statement can be elided or
converted to a move operation if an automatic storage duration variable is returned\iref{class.copy.elision}.
A copy operation associated with a \tcode{return} statement can be elided\iref{class.copy.elision}
or converted to a move operation if an implicitly movable entity\iref{expr.prim.id.unqual} is returned.
\end{note}

\pnum
Expand Down Expand Up @@ -993,6 +993,10 @@
\item
If the operand is a \grammarterm{braced-init-list} or an expression of non-\keyword{void} type,
\placeholder{S} is \placeholder{p}\tcode{.return_value(}\grammarterm{expr-or-braced-init-list}{}\tcode{)}.
\begin{note}
The overload resolution of \placeholder{S} is affected
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/of/inside/?

by whether the operand is an implicitly movable entity\iref{expr.prim.id.unqual}.
\end{note}
The expression \placeholder{S} shall be a prvalue of type \keyword{void}.

\item
Expand Down