Skip to content

[basic.lval] p5 An id-expression naming the reference denotes the reference  #44

Open
@xmh0511

Description

@xmh0511

Full name of submitter (unless configured in github; will be published with the issue): Jim X

[basic.lval] p5 says

The result of a glvalue is the entity denoted by the expression.

Consider this example:

int a = 0;
int& rf = a;
rf;

In this case, rf is an unqualified-id denoting the reference, per [expr.prim.id.unqual] p3 and [basic.pre] p5. whilst rf is also an lvalue as per [expr.prim.id.unqual] p3. According to [basic.lval] p5, the result of lvalue rf is the reference. However, a glvalue either denotes an object or a function, the result of the lvalue rf should intend to be the object denoted by a. Maybe, we should use "designate" in place of "denote" in [basic.lval] p5, as the following:

The result of a glvalue is the entity designated by the expression.

Everywhere, we should clearly define what entity the expression designates. Such as, we have defined what entity an unqualified-id introduced by a reference declaration designates in [expr.type] p1

The expression designates the object or function denoted by the reference to which the reference is bound.

Such as changing [expr.unary.op] p1 as the following:

the result is an lvalue referring to designating the object or function to which the expression points.

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