wg21.cmeerw.net

Proposed resolution (November, 2014):

Change 6.8.6.4 [basic.stc.auto] paragraph 3 as follows:

If a variable with automatic storage duration has initialization or a destructor with side effects, it an implementation shall not be destroyed destroy it before the end of its block, nor shall it be eliminated eliminate it as an optimization, even if it appears to be unused, except that a class object or its copy/move may be eliminated as specified in 11.4.5.3 [class.copy.ctor].

According to 6.8.6.4 [basic.stc.auto] paragraph 3,

If a variable with automatic storage duration has initialization or a destructor with side effects, it shall not be destroyed before the end of its block, nor shall it be eliminated as an optimization even if it appears to be unused, except that a class object or its copy/move may be eliminated as specified in 11.4.5.3 [class.copy.ctor].

This is intended to be a requirement for the implementation, but it could be read as prohibiting the reuse of the storage of an automatic variable by the program using a placement new-expression.

History Date User Action Args 2017-02-06 00:00:00adminsetstatus: drwp -> cd4 2015-11-10 00:00:00adminsetstatus: dr -> drwp 2015-05-25 00:00:00adminsetmessages: + msg6041 2015-05-25 00:00:00adminsetstatus: tentatively ready -> dr 2014-11-24 00:00:00adminsetmessages: + msg5159 2014-06-29 00:00:00admincreate

Read the original on wg21.cmeerw.net ↗