Title
Empty initializers vs. empty packs
Status
tentatively ready
Section
9.5 [dcl.init]
Submitter
Jay Ghiron

Created on 2026-08-30.00:00:00 last changed yesterday

Messages

Date: 2026-09-03.23:06:47

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: ... ] ...
Date: 2026-08-30.00:00:00

(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.

History
Date User Action Args
2026-09-03 23:06:47adminsetstatus: open -> tentatively ready
2026-08-30 20:20:05adminsetmessages: + msg8672
2026-08-30 00:00:00admincreate