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

2024-12-19


1985. Unknown bound array member with brace-or-equal-initializer

Section: 9.4.2  [dcl.init.aggr]     Status: NAD     Submitter: Hubert Tong     Date: 2014-08-09

The correct interpretation of an example like the following is not clear:

  struct A {
    int x[] = { 0 };
  };

Should the initializer be considered as implicitly determining the omitted array bound?

Rationale (November, 2014):

The requirement for determining an omitted bound in an aggregate is that it be “initialized” (9.4.5 [dcl.init.list] paragraph 4); since the brace-or-equal-initializer might, in fact, be ignored in some or all uses of the class, it should not be considered as definitively initializing the member and thus does not determine the array bound. Clarification of this intent could be done editorially, but CWG felt that no normative change was required.