Created on 2011-04-16.00:00:00 last changed 2 months ago
[Voted into the WP at the July, 2017 meeting as document P0727R0.]
Proposed resolution (March, 2017):
Change Clause 7 [expr] paragraph 12 as follows:
...is applied. [Note: If the expression is an lvalue of class type, it must have a volatile copy constructor to initialize the temporary that is the result object of the lvalue-to-rvalue conversion. —end note] The glvalue expression...
Change 6.7.7 [class.temporary] paragraph 6 as follows:
The third context is when a reference is bound to a temporary .116 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
A temporary object bound to a reference parameter...
Change 126.96.36.199 [over.match.copy] bullet 1.2 as follows:
When the type of the initializer expression is a class type “cv S”, the non-explicit conversion functions of S and its base classes are considered. When initializing a temporary to be bound to the first parameter of a constructor...
Change 188.8.131.52 [res.on.arguments] bullet 1.3 as follows:
...[Note: If a program casts an lvalue to an xvalue while passing that lvalue to a library function (e.g. by calling the function with the argument std::move(x)), the program is effectively asking that function to treat that lvalue as a temporary . The implementation is free...
Change 184.108.40.206 [util.smartptr.weak.assign] paragraph 2 as follows:
Remarks: The implementation may meet the effects (and the implied guarantees) via different means, without creating a temporary .
Change the footnote in 220.127.116.11 [template.valarray.overview] paragraph 1 as follows:
...generalized subscript operators. [Footnote: The intent is to specify an array template that hass the minimum functionality necessary to address aliasing ambiguities and the proliferation of
temporaries. Thus... —end footnote]
Change the last bullet of C.4.15 [diff.cpp03.input.output] as follows:
initializing a const bool & which would bind to a temporary .
Additional note, November, 2014:
Concerns have been raised that the meaning of “corresponding temporary object” is not clear enough in the proposed wording. In addition, N3918 says that it resolves issue 1300, but that issue is 1) marked as a duplicate of issue 914 and 2) the subject of continuing deliberations in EWG. This issue is being returned to "review" status to allow CWG to address these concerns.
The Standard is insufficiently precise in dealing with temporaries. It is not always clear when the term “temporary” is referring to an expression whose result is a prvalue and when it is referring to a temporary object.
(See also issue 1568.)
|2020-12-15 00:00:00||admin||set||status: drwp -> cd5|
|2018-02-27 00:00:00||admin||set||messages: + msg6142|
|2018-02-27 00:00:00||admin||set||messages: + msg6141|
|2018-02-27 00:00:00||admin||set||status: drafting -> drwp|
|2014-11-24 00:00:00||admin||set||messages: + msg5209|
|2014-11-24 00:00:00||admin||set||status: ready -> drafting|
|2014-03-03 00:00:00||admin||set||messages: + msg4837|
|2014-03-03 00:00:00||admin||set||status: drafting -> ready|
|2013-10-14 00:00:00||admin||set||status: open -> drafting|