Created on 2013-05-31.00:00:00, last changed 2017-02-06.00:00:00.
[Moved to DR at the November, 2014 meeting.]
Proposed resolution (June, 2014):
Add the following after 11.6.1 [dcl.init.aggr] paragraph 7:
If an aggregate class C contains a subaggregate...
Delete the first bullet of 15.2 [class.temporary] paragraph 5:
The second context is when a reference is bound to a temporary.117 The temporary to which the reference is bound or the temporary that is the complete object of a subobject to which the reference is bound persists for the lifetime of the reference except:
A temporary bound to a reference member in a constructor's ctor-initializer (15.6.2 [class.base.init]) persists until the constructor exits.
Insert the following as a new paragraph after 15.6.2 [class.base.init] paragraph 7:
In a non-delegating constructor, if a given potentially constructed subobject...
Insert the following as a new paragraph after 15.6.2 [class.base.init] paragraph 9:
In a non-delegating constructor, the destructor for each potentially constructed subobject...
This resolution also resolves issue 1815.
Presumably a temporary bound to a reference in a non-static data member initializer should be treated analogously with what happens in a ctor-initializer, but the current wording of 15.2 [class.temporary] paragraph 5 is not clear on this point.
See also issue 1815 for similar questions regarding aggregate initialization.
|2017-02-06 00:00:00||admin||set||status: drwp -> cd4|
|2015-05-25 00:00:00||admin||set||status: dr -> drwp|
|2015-04-13 00:00:00||admin||set||messages: + msg5395|
|2014-11-24 00:00:00||admin||set||status: tentatively ready -> dr|
|2014-07-07 00:00:00||admin||set||messages: + msg5081|
|2014-07-07 00:00:00||admin||set||status: drafting -> tentatively ready|
|2014-03-03 00:00:00||admin||set||status: open -> drafting|