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

2024-04-18


1848. Parenthesized constructor and destructor declarators

Section: 11.4.7  [class.dtor]     Status: CD4     Submitter: Richard Smith     Date: 2014-02-03

[Moved to DR at the November, 2014 meeting.]

The description of the required syntax for declaring a destructor in 11.4.7 [class.dtor] paragraph 1 says,

A declaration of a destructor uses a function declarator (9.3.4.6 [dcl.fct]) of the form

where the ptr-declarator...

A declaration such as

    (~S())

arguably “uses” a declarator of the required form, since the cited wording does not forbid placing a declarator of that form inside parentheses. (Similar considerations apply to the syntax of constructors in 11.4.5 [class.ctor] paragraph 1.) There is implementation divergence on this point. The wording should be clarified as to whether parentheses surrounding a declarator of the required form are permitted or not.

Proposed Resolution (July, 2014):

  1. Change 11.4.5 [class.ctor] paragraph 1 as follows:

  2. Constructors do not have names. A In a declaration of a constructor, uses the declarator is a function declarator (9.3.4.6 [dcl.fct]) of the form...
  3. Change 11.4.7 [class.dtor] paragraph 1 as follows:

  4. A In a declaration of a destructor, uses the declarator is a function declarator (9.3.4.6 [dcl.fct]) of the form...