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

2025-03-08


2993. Body of a destructor

Section: 9.5.1  [dcl.fct.def.general]     Status: open     Submitter: Hubert Tong     Date: 2025-02-14

(From submission #672.)

Subclause 9.5.1 [dcl.fct.def.general] paragraph 1 specifies additional implicit actions performed by the body of a constructor, but neglects destructors.

Possible resolution:

Change in 9.5.1 [dcl.fct.def.general] paragraph 1 as follows:

... Any informal reference to the body of a function should be interpreted as a reference to the non-terminal function-body, including, for For a constructor, this includes default member initializers or default initialization used to initialize a base or member subobject in the absence of a mem-initializer-id (11.9.3 [class.base.init]). For a destructor, this includes invocations of destructors for base and member subobjects. The optional attribute-specifier-seq in a function-definition appertains to the function. A function-definition with a virt-specifier-seq shall be a member-declaration (11.4 [class.mem]). A function-definition with a requires-clause shall define a templated function.