Skip to content

[expr.comma, class.base.init] What is "temporary expression"? #1910

Open
@cpplearner

Description

@cpplearner

The phrase "temporary expression" does not seem to be a defined term. It is used in the following contexts:

[expr.comma]/1:

If the right operand is a temporary expression ([class.temporary]), the result is a temporary expression.

[class.base.init]/8:

A temporary expression bound to a reference member in a mem-initializer is ill-formed.

[class.base.init]/11:

A temporary expression bound to a reference member from a default member initializer is ill-formed.

The sentence in [expr.comma]/1 was added by CWG 462 and has editorial adjustments applied later. CWG 462 should probably be superseded by CWG 1299 and thus that sentence could be removed.

The ones in [class.base.init] could probably say "temporary object" rather than "temporary expression".

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