Created on 2013-06-01.00:00:00 last changed 60 months ago
[Adopted as paper P0135R1 at the June, 2016 meeting.]
In an example like,
struct S { ~S(); };
struct X { X(); X(const X&); };
struct T { S &&s; X x; };
void f();
void g() { T t = T{ {}, {} }; f(); }
it appears that the current wording allows two ways of handling this:
The copy to t in g is not elided. X(const X&) is called, then ~S() is called, then f() is called.
However, EDG and g++ produce a third behavior: they do not call X(const X&), but they destroy the S() temporary at the end of its full-expression. The current wording does not appear to permit this behavior, but it seems preferable that lifetime extension does not depend on whether copy elision is done.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2020-12-15 00:00:00 | admin | set | status: drafting -> cd4 |
| 2013-10-14 00:00:00 | admin | set | status: open -> drafting |
| 2013-06-01 00:00:00 | admin | create | |