Skip to content

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

Open

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

Activity

  1. t3nsor commented on Jun 27, 2026

    @t3nsor

    We also use a phrase synonymous with "virtual base class or base class thereof" in [conv.mem] and twice in [expr.static.cast]. I think we should introduce a defined term for it. P0149 suggests "transitively virtual base class". Seems like a fine idea to me.

  2. jensmaurer commented on Jun 29, 2026

    @jensmaurer
    Member
  3. changed the title [-][basic.life] reference binding to base of virtual base outside of lifetime[/-] [+]CWG3208 [basic.life] reference binding to base of virtual base outside of lifetime[/+] on Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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