Title
Should new std::initializer_list<T> be ill-formed?
Status
nad
Section
7.6.2.8 [expr.new]
Submitter
Steve Adamczyk

Created on 2012-10-10.00:00:00 last changed 143 months ago

Messages

Date: 2013-02-15.00:00:00

Rationale (February, 2013):

Because the library emulation of std::is_constructible uses unevaluated new-expressions in the implementation, making a new of std::initializer_list ill-formed would give the wrong results for its constructibility. CWG determined that it would be acceptable to leave diagnosing of actual undefined behavior resulting from such constructs to the discretion of the implementation.

Date: 2012-10-15.00:00:00

Notes from the October, 2012 meeting:

The consensus of CWG was that this usage should be ill-formed.

Date: 2012-10-10.00:00:00

A new-expression that creates an object whose type is a specialization of std::initializer_list initialized from an initializer list results in undefined behavior if the object survives past the end of the full-expression, when the lifetime of the underlying array object ends. Since such a new-expression is effectively useless, should it be made ill-formed?

History
Date User Action Args
2013-03-18 00:00:00adminsetmessages: + msg4303
2013-03-18 00:00:00adminsetstatus: drafting -> nad
2012-11-03 00:00:00adminsetmessages: + msg4092
2012-10-10 00:00:00admincreate