diff --git a/source/declarations.tex b/source/declarations.tex index 22e0824e7d..1452788daf 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -4347,7 +4347,7 @@ The initialization that occurs in the \tcode{=} form of a \grammarterm{brace-or-equal-initializer} or \grammarterm{condition}\iref{stmt.select}, -as well as in argument passing, function return, +as well as in argument passing, throwing an exception\iref{except.throw}, handling an exception\iref{except.handle}, and aggregate member initialization\iref{dcl.init.aggr}, diff --git a/source/statements.tex b/source/statements.tex index 960e563c69..c4c3a45b06 100644 --- a/source/statements.tex +++ b/source/statements.tex @@ -826,11 +826,15 @@ A \tcode{return} statement with an operand of type \tcode{void} shall be used only in a function whose return type is \cv{}~\tcode{void}. A \tcode{return} statement with any other operand shall be used only -in a function whose return type is not \cv{}~\tcode{void}; +in a function whose return type is not \cv{}~\tcode{void}. + +\pnum \indextext{conversion!return type}% -the \tcode{return} statement initializes the -glvalue result or prvalue result object of the (explicit or implicit) function call -by copy-initialization\iref{dcl.init} from the operand. +The sequence of conversions applied to the operand of the \tcode{return} statement +is the same sequence which would be applied to the parenthesized operand, +if the parenthesized operand was used to copy-initialize\iref{dcl.init} +a hypothetical variable having the same type as the return type of the function +containing the \tcode{return} statement. \begin{note} A \tcode{return} statement can involve an invocation of a constructor to perform a copy or move of the operand