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

2026-09-04


3228. Empty initializers vs. empty packs

Section: 9.5  [dcl.init]     Status: tentatively ready     Submitter: Jay Ghiron     Date: 2026-08-30

(From submission #998.)

Consider:

  void foo(auto...x) {
    int y[]{x...};
  }
  void bar(auto...z) {
    int w(z...);
  }
  int main(){
    foo();
    bar();
  }

The rules around empty initializers are syntax-based and do not appear to address situations involving empty packs.

Proposed resolution (approved by CWG 2026-09-01):

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

    • ...
    • If the initializer is () of the form ( expression-listopt ) and the expression-list is absent (after any pack expansion (13.7.4 [temp.variadic])), the object is value-initialized. [ Note: ... ]
    • ...
  2. Change in 9.5.2 [dcl.init.aggr] paragraph 11 as follows:

    ... An array of unknown bound shall not be initialized with an empty a braced-init-list {} that has no elements. [ Footnote: ... ] ...