Skip to content

CWG3169 [class.mem.general] Issues with the definition of layout-compatibility #869

Open

Description

@Halalaluyafail3

Full name of submitter (unless configured in github; will be published with the issue): Jay Ghiron

Reference (section label): [class.mem.general]

Issue description:

This is split off from cplusplus/draft#8787. Some other issues were covered in #867.

Issue 1: Layout-compatible unions are not defined as being layout-compatible classes despite being classes and layout-compatible.

Issue 2: The wording "if their common initial sequence comprises all members and bit-fields of both classes" for layout-compatible classes includes all members, not just non-static data members when that clearly is not the intent.

Issue 3: Layout-compatible unions are not defined as considering the widths of bit-field members, but all implementations do consider the widths of bit-field members.

Issue 4: Layout-compatible unions are not defined as considering unnamed bit-fields since they are not members, but all implementations do consider the presence of unnamed bit-fields.

Issue 5: Layout-compatible unions are not defined as considering the use of no_unique_address, but all implementations do consider the use of no_unique_address if they support the attribute.

The solution to the second issue is provided in the pull request mentioned before.

Activity

  1. jensmaurer commented on Mar 14, 2026

    @jensmaurer
    Member
  2. changed the title [-][class.mem.general] Issues with the definition of layout-compatibility[/-] [+]CWG3169 [class.mem.general] Issues with the definition of layout-compatibility[/+] on Mar 14, 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