Skip to content

CWG2784 Unclear definition of member-designator for offsetof #1616

Description

@jensmaurer
  • Is a qualified-id allowed to appear in a member-designator?
  • Is a template-id allowed to appear in a member-designator?
  • Is an offsetof expression required to be a constant expression (7.7 [expr.const])?

See CWG2784 for details.

This issue lands right on the boundary of core and library specification, so EWG is asked to weigh in first, possibly deciding to involve L(E)WG.

Activity

  1. hubert-reinterpretcast commented on Sep 6, 2023

    @hubert-reinterpretcast
    Member

    In C, it seems everything that can be applied after the . token to get at a subobject is allowed. The questions may therefore extend to chains of .s and []s.

    For C++, a question is whether .*s with sufficiently-constant pointers-to-member is a bridge too far.

  2. erichkeane commented on Nov 7, 2023

    @erichkeane
    Collaborator

    EWG discussed CWG2784 during the Tuesday Morning session in Kona. The following poll was taken.

    CWG2784 "Unclear definition of member-designator for offsetof" this is an issue, we would like to see a paper which thoroughly explores the design space from and C++.

    SF F N A SA
    6 14 1 1 0

    Result: Consensus

  3. hanickadot commented on Jun 24, 2024

    @hanickadot
    Collaborator

    EWG St. Louis: Alisdair Meredith volunteered to write a paper to turn offsetof to keyword

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

    EWGEvolutionpaper neededAn issue needs a paper to describe its solution

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions