<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 1848</TITLE>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<STYLE TYPE="text/css">
  INS { text-decoration:none; font-weight:bold; background-color:#A0FFA0 }
  .INS { text-decoration:none; background-color:#D0FFD0 }
  DEL { text-decoration:line-through; background-color:#FFA0A0 }
  .DEL { text-decoration:line-through; background-color: #FFD0D0 }
  @media (prefers-color-scheme: dark) {
    HTML { background-color:#202020; color:#f0f0f0; }
    A { color:#5bc0ff; }
    A:visited { color:#c6a8ff; }
    A:hover, a:focus { color:#afd7ff; }
    INS { background-color:#033a16; color:#aff5b4; }
    .INS { background-color: #033a16; }
    DEL { background-color:#67060c; color:#ffdcd7; }
    .DEL { background-color:#67060c; }
  }
  SPAN.cmnt { font-family:Times; font-style:italic }
</STYLE>
</HEAD>
<BODY>
<P><EM>This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21
  Core Issues List revision 118b.
  See http://www.open-std.org/jtc1/sc22/wg21/ for the official
  list.</EM></P>
<P>2025-09-28</P>
<HR>
<A NAME="1848"></A><H4>1848.
  
Parenthesized constructor and destructor declarators
</H4>
<B>Section: </B>11.4.7&#160; [<A href="https://wg21.link/class.dtor">class.dtor</A>]
 &#160;&#160;&#160;

 <B>Status: </B>CD4
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-02-03<BR>


<P>[Moved to DR at the November, 2014 meeting.]</P>



<P>The description of the required syntax for declaring a
destructor in 11.4.7 [<A href="https://wg21.link/class.dtor#1">class.dtor</A>] paragraph 1 says,</P>

<BLOCKQUOTE>

<P>A declaration of a destructor uses a function declarator
(9.3.4.6 [<A href="https://wg21.link/dcl.fct">dcl.fct</A>]) of the form</P>

<UL>
<I>ptr-declarator</I> <TT>(</TT> <I>parameter-declaration-clause</I> <TT>)</TT> <I>exception-specification<SUB>opt</SUB> attribute-specifier-seq<SUB>opt</SUB></I>

</UL>

<P>where the <I>ptr-declarator</I>...</P>

</BLOCKQUOTE>

<P>A declaration such as</P>

<PRE>
    (~S())
</PRE>

<P>arguably &#8220;uses&#8221; 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 [<A href="https://wg21.link/class.ctor#1">class.ctor</A>] 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.</P>

<P><B>Proposed Resolution (July, 2014):</B></P>

<OL>
<LI><P>Change 11.4.5 [<A href="https://wg21.link/class.ctor#1">class.ctor</A>] paragraph 1 as follows:</P></LI>

<BLOCKQUOTE>

Constructors do not have names. <DEL>A</DEL> <INS>In a</INS>
declaration of a constructor<INS>,</INS> <DEL>uses</DEL>
<INS>the <I>declarator</I> is</INS> a function declarator
(9.3.4.6 [<A href="https://wg21.link/dcl.fct">dcl.fct</A>]) of the form...

</BLOCKQUOTE>

<LI><P>Change 11.4.7 [<A href="https://wg21.link/class.dtor#1">class.dtor</A>] paragraph 1 as follows:</P></LI>

<BLOCKQUOTE>

<DEL>A</DEL> <INS>In a</INS> declaration of a
destructor<INS>,</INS> <DEL>uses</DEL> <INS>the <I>declarator</I>
is</INS> a function declarator (9.3.4.6 [<A href="https://wg21.link/dcl.fct">dcl.fct</A>])
of the form...

</BLOCKQUOTE>

</OL>

<BR><BR>
</BODY>
</HTML>
