Skip to content

CWG2784 Unclear definition of member-designator for offsetof #1616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jensmaurer opened this issue Aug 23, 2023 · 3 comments
Open

CWG2784 Unclear definition of member-designator for offsetof #1616

jensmaurer opened this issue Aug 23, 2023 · 3 comments
Labels
EWG Evolution paper needed An issue needs a paper to describe its solution

Comments

@jensmaurer
Copy link
Member

  • 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.

@hubert-reinterpretcast
Copy link

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.

@erichkeane
Copy link
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

@erichkeane erichkeane added the paper needed An issue needs a paper to describe its solution label Mar 18, 2024
@hanickadot
Copy link
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
Labels
EWG Evolution paper needed An issue needs a paper to describe its solution
Projects
None yet
Development

No branches or pull requests

4 participants