Title
Reuse of storage of automatic variables
Status
cd4
Section
6.7.5.4 [basic.stc.auto]
Submitter
Daniel Krügler

Created on 2014-06-29.00:00:00 last changed 94 months ago

Messages

Date: 2015-05-15.00:00:00

[Moved to DR at the May, 2015 meeting.]

Date: 2014-11-15.00:00:00

Proposed resolution (November, 2014):

Change 6.7.5.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].
Date: 2022-02-18.07:47:23

According to 6.7.5.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