This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 110c. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2023-02-07


793. Use of class members during destruction

Section: 6.7.3  [basic.life]     Status: CD2     Submitter: US     Date: 3 March, 2009

N2800 comment US 26

[Voted into WP at March, 2010 meeting.]

Read literally, 6.7.3 [basic.life] paragraphs 1 and 5 would make any access to non-static members of a class from the class's destructor undefined behavior. This is clearly not the intent.

Proposed resolution (October, 2009):

Change 6.7.3 [basic.life] paragraphs 5-6 as follows:

...any pointer that refers to the storage location where the object will be or was located may be used but only in limited ways. Such For an object under construction or destruction, see 11.9.5 [class.cdtor]. Otherwise, such a pointer refers to allocated storage...

...any lvalue which refers to the original object may be used but only in limited ways. Such For an object under construction or destruction, see 11.9.5 [class.cdtor]. Otherwise, such an lvalue refers to allocated storage...