Skip to content

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

@Halalaluyafail3

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.

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