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-06-27


3201. Zero- and default-initialization of cv-qualified std::meta::info

Section: 9.5.1  [dcl.init.general]     Status: tentatively ready     Submitter: Jiang An     Date: 2026-06-10

(From submission #920.)

Subclauses 9.5.1 [dcl.init.general] bullet 6.1 and 9.5.1 [dcl.init.general] bullet 7.3 do not, but ought to, handle cv-qualified std::meta::info.

Proposed resolution (approved by CWG 2026-06-26):

  1. Change in 9.5.1 [dcl.init.general] paragraph 6 as follows:

    To zero-initialize an object or reference of type cv T means:
    • if T is std::meta::info, the object is initialized to a null reflection value;
    • if T is any other scalar type (6.9.1 [basic.types.general]), the object is initialized to the value obtained by converting the integer literal 0 (zero) to T; [ Footnote: ... ]
    • if T is a (possibly cv-qualified) non-union class type, its padding bits (6.9.1 [basic.types.general]) are initialized to zero bits and each non-static data member, each non-virtual base class subobject, and, if the object is not a base class subobject, each virtual base class subobject is zero-initialized;
    • if T is a (possibly cv-qualified) union type, its padding bits (6.9.1 [basic.types.general]) are initialized to zero bits and the object's first non-static named data member is zero-initialized;
    • if T is an array type, each element is zero-initialized;
    • if T is a reference type, no initialization is performed.
  2. Change in 9.5.1 [dcl.init.general] paragraph 7 as follows:

    To default-initialize an object of type cv T means:
    • If T is a (possibly cv-qualified) class type (Clause Clause 11 [class]), constructors are considered. The applicable constructors are enumerated (12.2.2.4 [over.match.ctor]), and the best one for the initializer () is chosen through overload resolution (12.2 [over.match]). The constructor thus selected is called, with an empty argument list, to initialize the object.
    • If T is an array type, the semantic constraints of default-initializing a hypothetical element shall be met and each element is default-initialized.
    • If T is std::meta::info, the object is zero-initialized.
    • Otherwise, no initialization is performed.