<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 2620</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="2620"></A><H4>2620.
  
Nonsensical disambiguation rule
</H4>
<B>Section: </B>9.3.3&#160; [<A href="https://wg21.link/dcl.ambig.res">dcl.ambig.res</A>]
 &#160;&#160;&#160;

 <B>Status: </B>C++23
 &#160;&#160;&#160;

 <B>Submitter: </B>Krystian Stasiowski
 &#160;&#160;&#160;

 <B>Date: </B>2019-04-18<BR>


<P>[Accepted as a DR at the November, 2022 meeting.]</P>

<P>Subclause 9.3.3 [<A href="https://wg21.link/dcl.ambig.res#1">dcl.ambig.res</A>] paragraph 1 specifies:</P>

<BLOCKQUOTE>

The ambiguity arising from the similarity between a function-style
cast and a declaration mentioned in 8.11 [<A href="https://wg21.link/stmt.ambig">stmt.ambig</A>] can also
occur in the context of a declaration. In that context, the choice is
between a function declaration with a redundant set of parentheses
around a parameter name and an object declaration with a
function-style cast as the initializer. Just as for the ambiguities
mentioned in 8.11 [<A href="https://wg21.link/stmt.ambig">stmt.ambig</A>], the resolution is to consider
any construct that could possibly be a declaration a declaration.

</BLOCKQUOTE>

<P>The specification correctly describes an ambiguity between a
function declaration and an object declaration, but resolves the
ambiguity to a "declaration", which does not offer any insight.</P>

<P><B>Proposed resolution (2022-09-09) [SUPERSEDED]:</B></P>

<P>Change in 9.3.3 [<A href="https://wg21.link/dcl.ambig.res#1">dcl.ambig.res</A>] paragraph 1 as follows:</P>

<BLOCKQUOTE>

... <DEL>Just as for the ambiguities mentioned in
8.11 [<A href="https://wg21.link/stmt.ambig">stmt.ambig</A>], the</DEL> <INS>The</INS> resolution is to
consider any construct that could possibly be a <INS>function</INS>
declaration a <INS>function</INS> declaration.

</BLOCKQUOTE>

<P><B>Proposed resolution (approved by CWG 2022-09-23):</B></P>

<P>Change in 9.3.3 [<A href="https://wg21.link/dcl.ambig.res#1">dcl.ambig.res</A>] paragraph 1 as follows:</P>

<BLOCKQUOTE>

The ambiguity arising from the similarity between a function-style
cast and a declaration mentioned in 8.11 [<A href="https://wg21.link/stmt.ambig">stmt.ambig</A>] can also
occur in the context of a declaration. In that context, the choice is
between
<DEL>a function declaration with a redundant set of parentheses around
a parameter name and</DEL> an object declaration with a function-style
cast as the initializer
<INS>and a declaration involving a function declarator with a
redundant set of parentheses around a parameter name</INS>.  Just as
for the ambiguities mentioned in 8.11 [<A href="https://wg21.link/stmt.ambig">stmt.ambig</A>], the
resolution is to consider any construct<INS>, such as the potential
parameter declaration,</INS> that could possibly be a
declaration <INS>to be</INS> a declaration.

</BLOCKQUOTE>

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