Title
Access checking for initializer_list array initialization
Status
cd3
Section
9.4.5 [dcl.init.list]
Submitter
John Spicer

Created on 2012-07-12.00:00:00 last changed 90 months ago

Messages

Date: 2013-04-15.00:00:00

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

Date: 2012-10-15.00:00:00

Proposed resolution (October, 2012):

Change 9.4.5 [dcl.init.list] paragraph 4 as follows:

...Each element of that array is copy-initialized with the corresponding element of the initializer list, and the std::initializer_list<E> object is constructed to refer to that array. [Note: A constructor or conversion function selected for the copy shall be accessible (Clause 11.8 [class.access]) in the context of the initializer list. —end note] If a narrowing conversion is required...
Date: 2012-07-12.00:00:00

In constructing an initializer_list object from an initializer list, 9.4.5 [dcl.init.list] paragraph 5 says of the underlying array,

Each element of that array is copy-initialized with the corresponding element of the initializer list

It would probably be good to mention that the copy/move constructor for this copy must be accessible in the context in which the initialization occurs.

History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: drwp -> cd3
2013-10-14 00:00:00adminsetstatus: dr -> drwp
2013-05-03 00:00:00adminsetmessages: + msg4412
2013-05-03 00:00:00adminsetstatus: ready -> dr
2012-11-03 00:00:00adminsetmessages: + msg4065
2012-11-03 00:00:00adminsetstatus: open -> ready
2012-07-12 00:00:00admincreate