Skip to content

CWG3029 [basic.align] Note about weakest alignment for narrow char types is confusing #687

Open
@limdor

Description

@limdor

Full name of submitter: Xavier Bonaventura

Reference: basic.aling/6

Link to reflector thread: https://chat.isocpp.org/general/pl/yjx3qdhrajfoxbifprpf8p16we (no reflector thread, just mattermost discussion)

Issue description:
https://eel.is/c++draft/basic.memobj#intro.object-3 says

If a complete object is created ([expr.new]) in storage associated with another object e of type “array of N unsigned char” or of type “array of N std​::​byte” ([cstddef.syn]), that array provides storage for the created object if

However, in https://eel.is/c++draft/basic.memobj#basic.align-6 the note says

[Note 2: This enables the ordinary character types to be used as the underlying type for an aligned memory area ([dcl.align]). — end note]

Implying that any narrow character type could be use to provide storage when only "unsigned char" or "std::byte" is allowed.

Suggested resolution:

Remove Note 2 from https://eel.is/c++draft/basic.memobj#basic.align-6

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