Skip to content

[dcl.init] Initialization of array of signed char or array of unsigned char with string literal #921

@Halalaluyafail3

Description

@Halalaluyafail3

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

Reference (section label): [dcl.init]/16.3

Issue description:

If the destination type is an array of characters, an array of char8_t, an array of char16_t, an array of char32_t, or an array of wchar_t, and the initializer is a string-literal, see [dcl.init.string].

"an array of characters" does not clearly allow code such as the following, for example if it is interpreted as "an array of char":

signed char x[1]="";
unsigned char y[1]="";

Existing implementations allow this, and the wording in [dcl.init.string] intends on allowing it too.

Suggested resolution:

Modify [dcl.init]/16.3:

If the destination type is an array of ordinary characters type, an array of char8_t, an array of char16_t, an array of char32_t, or an array of wchar_t, and the initializer is a string-literal, see [dcl.init.string].

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions