Description
As pointed by #4107, #3124, and #3587, the glvalue result is being unclear in the current draft. The glvalue result sometimes has the meaning(namely, anonymous reference) as mentioned in this comment #4107 (comment), but it's not normative wording. I think we should reword the wording for "glvalue result" of a function call to make it more clear. My suggestion is
if the function call is a prvalue, the return statement initializes the prvalue result object of the (explicit or implicit) function call by copy-initialization from the operand.
Otherwise, if the function call is a glvalue, the return statement is equivalent to the following hypothetical declaration
T t = e;
if the operand of the return statement is a comma expression X without parenthesis, e is(X)
, otherwise e isX
. T is the return type of the function call;The invented variable
t
is the result of the function call.
Here, the invented variable t
is the so-called anonymous reference for purpose.