Created on2011-04-06.00:00:00 last changed143 months ago
[Voted into the WP at the February, 2012 meeting;moved to DR at the October, 2012 meeting.]
Proposed resolution (August, 2011):
Change 9.5.5 [dcl.init.list] paragraph 3 as follows:
...
Otherwise, ifT is a class type, constructors areconsidered...
Otherwise, ifT is a reference type, a prvaluetemporary of the type referenced byT is list-initialized,and the reference is bound to that temporary. [Note: As usual,the binding will fail and the program is ill-formed if the referencetype is an lvalue reference to a non-const type. —endnote] [Example: ... —endexample]
Otherwise, if the initializer list has a single elementoftypeE and eitherT is not a reference type or itsreferenced type is reference-related toE, the objector reference is initialized from that element; if a narrowingconversion (see below) is required to convert the element toT, the program is ill-formed. [Example:...
Otherwise, ifT is a reference type, a prvaluetemporary of the type referenced byT is list-initialized,and the reference is bound to that temporary. [Note: As usual,the binding will fail and the program is ill-formed if the referencetype is an lvalue reference to a non-const type. —endnote] [Example: ... —endexample]
Otherwise, if the initializer list has no elements...
...
One might expect that in an example like
int i; int & ir{i};ir would bind directly toi. However, accordingto 9.5.5 [dcl.init.list] paragraph 3, this example creates atemporary of typeint and binds the reference to thattemporary:
...
Otherwise, ifT is a reference type, a prvaluetemporary of the type referenced byT is list-initialized,and the reference is bound to that temporary...
Otherwise, if the initializer list has a single element, theobject or reference is initialized from that element...
Also, the “or reference” in the last bullet is deadcode, as a reference initialization is always handled by the precedingbullet.

| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2014-03-03 00:00:00 | admin | set | status: drwp -> cd3 |
| 2012-11-03 00:00:00 | admin | set | status: dr -> drwp |
| 2012-09-24 00:00:00 | admin | set | messages: +msg4009 |
| 2012-02-27 00:00:00 | admin | set | messages: +msg3819 |
| 2012-02-27 00:00:00 | admin | set | status: ready -> dr |
| 2011-04-06 00:00:00 | admin | create | |