Created on 2000-01-31.00:00:00 last changed 168 months ago
[Moved to DR at 4/01 meeting.]
Proposed resolution (04/01):
[Note: this proposal also addresses issue 124.]
Add to the end of 6.9.1 [intro.execution] paragraph 12:
If the initializer for an object or sub-object is a full-expression, the initialization of the object or sub-object (e.g., by calling a constructor or copying an expression value) is considered to be part of the full-expression.
Replace 6.7.7 [class.temporary] paragraph 4 with:
There are two contexts in which temporaries are destroyed at a different point than the end of the full-expression. The first context is when a default constructor is called to initialize an element of an array. If the constructor has one or more default arguments, any temporaries created in the default argument expressions are destroyed immediately after return from the constructor.
According to 6.7.7 [class.temporary] paragraph 4, an expression appearing as the initializer in an object definition constitutes a context "in which temporaries are destroyed at a different point than the end of the full-expression." It goes on to say that the temporary containing the value of the expression persists until after the initialization is complete (see also issue 117). This seems to presume that the end of the full-expression is a point earlier than the completion of the initialization.
However, according to 6.9.1 [intro.execution] paragraphs 12-13, the full-expression in such cases is, in fact, the entire initialization. If this is the case, the behavior described for temporaries in an initializer expression is simply the normal behavior of temporaries in any expression, and treating it as an exception to the general rule is both incorrect and confusing.
|2008-10-05 00:00:00||admin||set||status: wp -> cd1|
|2003-04-25 00:00:00||admin||set||status: dr -> wp|
|2002-05-10 00:00:00||admin||set||messages: + msg684|
|2001-05-20 00:00:00||admin||set||status: ready -> dr|
|2000-11-18 00:00:00||admin||set||status: review -> ready|
|2000-05-21 00:00:00||admin||set||messages: + msg338|
|2000-05-21 00:00:00||admin||set||status: open -> review|