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

2024-12-06


1029. Type of a destructor call

Section: 11.4.7  [class.dtor]     Status: C++11     Submitter: Johannes Schaub     Date: 2010-02-08

[Voted into the WP at the November, 2010 meeting.]

The Standard does not define the type of a destructor call. Although that is not of any practical importance, it should do so as a matter of completeness. (_N4778_.7.6.1.4 [expr.pseudo] paragraph 1 defines the type of a pseudo-destructor call as void.)

Proposed resolution (September, 2010):

Change 7.6.1.3 [expr.call] paragraph 3 as follows:

The If the postfix-expression designates a destructor (11.4.7 [class.dtor]), the type of the function call expression is void; otherwise, the type of the function call expression is the return type of the statically chosen function (i.e., ignoring the virtual keyword), even if the type of the function actually called is different. This type shall be a complete object type, a reference type or the type void.