This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-11-11


2784. Unclear definition of member-designator for offsetof

Section: 17.2.4  [support.types.layout]     Status: open     Submitter: Corentin Jabot     Date: 2023-08-21     Liaison: EWG

Consider:

  struct S {
    int a;
  };
  int x = offsetof(S, S::a)

Is this valid? MSVC and gcc appear to support qualified-ids in the member-designator of offsetof; clang does not. Once that question is clarified, the rules about value-dependence may need to be amended, because a qualified-id might introduce type-dependence.

Specific questions:

2023-08-23

Forwarded to EWG with paper issue #1616, by decision of the CWG chair.

EWG 2023-11-07

EWG is soliciting a paper to thoroughly explore the design space.