This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 112e. See for the official list.


1559. String too long in initializer list of new-expression

Section:  []     Status: CD3     Submitter: John Spicer     Date: 2012-09-21

[Moved to DR at the April, 2013 meeting.]

According to [] paragraph 7,

if the new-initializer is a braced-init-list for which the number of initializer-clauses exceeds the number of elements to initialize, no storage is obtained and the new-expression terminates by throwing an exception of a type that would match a handler (14.4 [except.handle]) of type std::bad_array_new_length ( [new.badlength]).

This wording does not, but presumably should, require an exception to be thrown in a case like

  void f() {
    int x = 3;
    new char[x]{"abc"};

(See also issue 1464.)

Proposed resolution (October, 2012):

This issue is resolved by the resolution of issue 1464.