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

2024-11-11


1241. Which members does a destructor destroy?

Section: 11.4.7  [class.dtor]     Status: C++11     Submitter: Ryou Ezoe     Date: 2011-02-08

[Voted into the WP at the March, 2011 meeting as part of paper N3262.]

The current wording of 11.4.7 [class.dtor] paragraph 7 says,

After executing the body of the destructor and destroying any automatic objects allocated within the body, a destructor for class X calls the destructors for X's direct non-variant members...

This is incorrect; it is only the non-static members that are destroyed.