CWG Issue 272 (original) (raw)
This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 118e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-11-05
272. Explicit destructor invocation and _qualified-id_s
Section: 11.4.7 [class.dtor]Status: CD1Submitter: Mike MillerDate: 22 Feb 2001
[Moved to DR at 10/01 meeting.]
11.4.7 [class.dtor] paragraph 12 contains the following note:
an explicit destructor call must always be written using a member access operator (7.6.1.5 [expr.ref]); in particular, the_unary-expression_ ~X() in a member function is not an explicit destructor call (7.6.2.2 [expr.unary.op]).
This note is incorrect, as an explicit destructor call can be written as a qualified-id, e.g., X::~X(), which does not use a member access operator.
Proposed resolution (04/01):
Change 11.4.7 [class.dtor] paragraph 12 as follows:
[_Note:_ an explicit destructor call must always be written using a member access operator (7.6.1.5 [expr.ref])or a qualified-id (_N4567_.5.1.1 [expr.prim.general]); in particular, the unary-expression ~X() in a member function is not an explicit destructor call (7.6.2.2 [expr.unary.op]).]