Skip to content

Commit a5d8063

Browse files
[stmt.return] Fix the operand's conversions description
1 parent 1c5f448 commit a5d8063

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

source/declarations.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -4347,7 +4347,7 @@
43474347
The initialization that occurs in the \tcode{=} form of a
43484348
\grammarterm{brace-or-equal-initializer} or
43494349
\grammarterm{condition}\iref{stmt.select},
4350-
as well as in argument passing, function return,
4350+
as well as in argument passing,
43514351
throwing an exception\iref{except.throw},
43524352
handling an exception\iref{except.handle},
43534353
and aggregate member initialization\iref{dcl.init.aggr},

source/statements.tex

+7-4
Original file line numberDiff line numberDiff line change
@@ -826,11 +826,14 @@
826826
A \tcode{return} statement with an operand of type \tcode{void} shall be used only
827827
in a function whose return type is \cv{}~\tcode{void}.
828828
A \tcode{return} statement with any other operand shall be used only
829-
in a function whose return type is not \cv{}~\tcode{void};
829+
in a function whose return type is not \cv{}~\tcode{void}.
830+
831+
\pnum
830832
\indextext{conversion!return type}%
831-
the \tcode{return} statement initializes the
832-
glvalue result or prvalue result object of the (explicit or implicit) function call
833-
by copy-initialization\iref{dcl.init} from the operand.
833+
The sequence of conversions applied to the operand of the \tcode{return} statement
834+
is the same as if the parenthesized operand was used to copy-initialize\iref{dcl.init}
835+
a hypothetical variable having the same type as the return type of the function
836+
containing the \tcode{return} statement.
834837
\begin{note}
835838
A \tcode{return} statement can involve
836839
an invocation of a constructor to perform a copy or move of the operand

0 commit comments

Comments
 (0)