Created on 2021-07-04.00:00:00 last changed 25 months ago
Notes from the August, 2021 teleconference:
A simpler approach would be simply to use a phrase like “returned object or reference” in place of the current wording referring to glvalues and prvalues. This change was regarded as editorial. The issue will remain in "review" status until CWG can look over the wording change.
Suggested resolution:
A return statement with any other operand shall be used only in a function whose return type is not cv void
;. If the function call is a prvalue, the return statement initializes theglvalue result orprvalue result object of the (explicit or implicit) function call by copy-initialization (9.4 [dcl.init]) from the operand. Otherwise, the return statement is equivalent to the following hypothetical declarationT t = e;
If the operand of the return statement, X, is a comma expression without parentheses, e is (X), otherwise e is X. T is the return type of the function call; the invented variable t is the result of the function call.
According to 8.7.4 [stmt.return] paragraph 1,
A return statement with any other operand shall be used only in a function whose return type is not cv void; the return statement initializes the glvalue result or prvalue result object of the (explicit or implicit) function call by copy-initialization (9.4 [dcl.init]) from the operand.
It is not clear what a “glvalue result” is or what it means to initialize it.
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-11-10 14:46:10 | admin | set | status: review -> open |
2022-02-18 07:47:23 | admin | set | messages: + msg6724 |
2021-11-15 00:00:00 | admin | set | messages: + msg6530 |
2021-07-04 00:00:00 | admin | create |