This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 114a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-04-18


1651. Lifetime extension of temporary via reference to subobject

Section: 6.7.7  [class.temporary]     Status: NAD     Submitter: Richard Smith     Date: 2013-04-15

The resolution of issues 616 and 1213, making the result of a member access or subscript expression applied to a prvalue an xvalue, means that binding a reference to such a subobject of a temporary does not extend the temporary's lifetime. 6.7.7 [class.temporary] should be revised to ensure that it does.

Proposed resolution (February, 2014): [SUPERSEDED]

This issue is resolved by the resolution of issue 1299.

Rationale (February, 2019):

This concern is already covered by 6.7.7 [class.temporary] paragraph 6:

The temporary object to which the reference is bound or the temporary object that is the complete object of a subobject to which the reference is bound persists for the lifetime of the reference if...