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

2022-08-19


1469. Omitted bound in array new-expression

Section: 7.6.2.8  [expr.new]     Status: CD5     Submitter: Johannes Schaub     Date: 2012-02-12

[Adopted at the February, 2019 meeting as part of paper P1009R2.]

The syntax for noptr-new-declarator in 7.6.2.8 [expr.new] paragraph 1 requires an expression, even though the bound could be inferred from a braced-init-list initializer. It is not clear whether 9.4.2 [dcl.init.aggr] paragraph 4,

An array of unknown size initialized with a brace-enclosed initializer-list containing n initializer-clauses, where n shall be greater than zero, is defined as having n elements (9.3.4.5 [dcl.array]).

should be considered to apply to the new-type-id variant, e.g.,

  new (int[]){1, 2, 3}

Additional note (August, 2012):

The consensus during the 2012-08-13 drafting review teleconference was that this issue should be referred to the Evolution Working Group and not handled by the Core Working Group.