Title
Parenthesized constructor and destructor declarators
Status
cd4
Section
11.4.7 [class.dtor]
Submitter
Richard Smith

Created on 2014-02-03.00:00:00 last changed 94 months ago

Messages

Date: 2014-11-15.00:00:00

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

Date: 2014-07-15.00:00:00

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...
Date: 2014-02-03.00:00:00

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

    ptr-declarator ( parameter-declaration-clause ) exception-specificationopt attribute-specifier-seqopt

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.

History
Date User Action Args
2017-02-06 00:00:00adminsetstatus: drwp -> cd4
2015-05-25 00:00:00adminsetstatus: dr -> drwp
2015-04-13 00:00:00adminsetmessages: + msg5398
2014-11-24 00:00:00adminsetstatus: tentatively ready -> dr
2014-10-13 00:00:00adminsetmessages: + msg5141
2014-10-13 00:00:00adminsetstatus: open -> tentatively ready
2014-02-03 00:00:00admincreate