Title
"Refers to allocated storage" has no meaning
Status
review
Section
6.7.4 [basic.life]
Submitter
Andrey Erokhin

Created on 2020-09-07.00:00:00 last changed 18 months ago

Messages

Date: 2023-06-15.20:01:37

Proposed resolution:

  1. Change in 6.7.4 [basic.life] paragraph 6 as follows:

    For an object under construction or destruction, see 11.9.5 [class.cdtor]. Otherwise, such a pointer refers to allocated storage (6.7.6.5.2 [basic.stc.dynamic.allocation]), and using the such a pointer as if the pointer were of type void* is well-defined.
  2. Change in 6.7.4 [basic.life] paragraph 7 as follows:

    For an object under construction or destruction, see 11.9.5 [class.cdtor]. Otherwise, such a glvalue refers to allocated storage (6.7.6.5.2 [basic.stc.dynamic.allocation]), and using the properties of the such a glvalue that do not depend on its value is well-defined.
Date: 2022-04-04.07:08:01

6.7.4 [basic.life] paragraph 6 specifies:

Before the lifetime of an object has started but after the storage which the object will occupy has been allocated or, after the lifetime of an object has ended and before the storage which the object occupied is reused or released, any pointer that represents the address of the storage location where the object will be or was located may be used but only in limited ways. For an object under construction or destruction, see 11.9.5 [class.cdtor]. Otherwise, such a pointer refers to allocated storage (6.7.6.5.2 [basic.stc.dynamic.allocation]), and using the pointer as if the pointer were of type void* is well-defined.

Similarly, 6.7.4 [basic.life] paragraph 7 specifies:

Similarly, before the lifetime of an object has started but after the storage which the object will occupy has been allocated or, after the lifetime of an object has ended and before the storage which the object occupied is reused or released, any glvalue that refers to the original object may be used but only in limited ways. For an object under construction or destruction, see 11.9.5 [class.cdtor]. Otherwise, such a glvalue refers to allocated storage (6.7.6.5.2 [basic.stc.dynamic.allocation]), and using the properties of the glvalue that do not depend on its value is well-defined.

In either case, it is unclear what "refers to allocated storage" means, beyond the properties ascribed to an object in 6.7.2 [intro.object].

See also issue 1853.

History
Date User Action Args
2023-06-15 20:01:37adminsetstatus: open -> review
2022-03-16 22:19:28adminsetmessages: + msg6766
2020-09-07 00:00:00admincreate