Skip to content

[basic.life] reference binding to base of virtual base outside of lifetime #936

Description

@leni536

Full name of submitter: Lénárd Szolnoki

Reference: [basic.life]

Link to reflector thread (if any):

Issue description

Referring to bases of virtual base classes is inconsistently restricted between pointer conversions and reference binding.

[basic.life] p7:

The program has undefined behavior if
...

(emphasis mine)

[basic.life] p8:

The program has undefined behavior if
...

  • the glvalue is bound to a reference to a virtual base class ([dcl.init.ref]), or

Paragraph 7 was modified by [CWG3001]. Missing paragraph 8 seems like an oversight here.

Suggested resolution

Modify the bullet point in [basic.life] p8:

  • the glvalue is bound to a reference to a virtual base class or to a base class thereof ([dcl.init.ref]), or

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions