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

2026-07-01


3203. Initialization of signed or unsigned char arrays from string-literal

Section: 9.5.1  [dcl.init.general]     Status: open     Submitter: Jay Ghiron     Date: 2026-06-11

(From submission #921.)

Subclause 9.5.3 [dcl.init.string] paragraph 1 clearly includes signed char and unsigned char in the list of array element types that can be initialized by a string-literal. However, 9.5.1 [dcl.init.general] bullet 16.3 does not.

Suggested resolution:

  1. Change in 9.5.1 [dcl.init.general] bullet 16.3 as follows:

    The semantics of initializers are as follows. The destination type is the cv-unqualified type of the object or reference being initialized and the source type is the type of the initializer expression. If the initializer is not a single (possibly parenthesized) expression, the source type is not defined.
    • ...
    • If the destination type is an array of characters ordinary character type or of character type (6.9.2 [basic.fundamental]) , 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 9.5.3 [dcl.init.string].
    • ...
  2. Change in 9.5.5 [dcl.init.list] bullet 3.3 as follows:

    List-initialization of an object or reference of type cv T is defined as follows:
    • ...
    • Otherwise, if T is a character array an array of ordinary character type or of character type (6.9.2 [basic.fundamental]) and the initializer list has a single element that is an appropriately-typed string-literal (9.5.3 [dcl.init.string]), initialization is performed as described in that subclause.
    • ...