Skip to content

[class.temporary] p6.11 Returned reference is clearer than returned value #6001

Closed
@xmh0511

Description

@xmh0511

[class.temporary] p6.11 says:

The lifetime of a temporary bound to the returned value in a function return statement ([stmt.return]) is not extended; the temporary is destroyed at the end of the full-expression in the return statement.

In [stmt.return], we say

the return statement initializes the returned reference or prvalue result object of the (explicit or implicit) function call by copy-initialization from the operand.

In [class.temporary] p6.11, it should mean returned reference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions