<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 2697</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="2697"></A><H4>2697.
  
Deduction guides using abbreviated function syntax
</H4>
<B>Section: </B>13.7.2.3&#160; [<A href="https://wg21.link/temp.deduct.guide">temp.deduct.guide</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>CWG
 &#160;&#160;&#160;

 <B>Date: </B>2023-02-11
  &#160;&#160;&#160;
  <B>Liaison: </B>EWG<BR>


<P>[Accepted as a DR at the June, 2023 meeting.]</P>

<P>It is unclear whether deduction guides can be expressed using
abbreviated function syntax.  Subclause 13.7.2.3 [<A href="https://wg21.link/temp.deduct.guide#3">temp.deduct.guide</A>] paragraph 3 refers to the <I>restrictions</I> of a
function's <I>parameter-declaration-clause</I>:</P>

<BLOCKQUOTE>

The same restrictions apply to the <I>parameter-declaration-clause</I>
of a deduction guide as in a function declaration
(9.3.4.6 [<A href="https://wg21.link/dcl.fct">dcl.fct</A>]). ...

</BLOCKQUOTE>

<P>However, that subclause is silent on the meaning of abbreviated
function syntax when used for deduction guides.  Furthermore,
9.3.4.6 [<A href="https://wg21.link/dcl.fct#22">dcl.fct</A>] paragraph 22 explicitly restricts the
definition to function templates, which deduction guides are not:</P>

<BLOCKQUOTE>

An <I>abbreviated function template</I> is a function declaration that
has one or more generic parameter type placeholders
(9.2.9.7 [<A href="https://wg21.link/dcl.spec.auto">dcl.spec.auto</A>]). ...

</BLOCKQUOTE>

<P>Arguably, the lack of template parameter names in abbreviated
function syntax makes it less suitable to specifiy deduction
guides.</P>

<P><B>CWG 2023-02-11</B></P>

<P>CWG solicits input from EWG whether abbreviated function syntax is
intended to be used for deduction guides.

See <A HREF="https://github.com/cplusplus/papers/issues/1465">cplusplus/papers#1465</A>.
</P>

<P><B>EWG 2023-05-11</B></P>

<P>CWG should clarify that abbreviated function syntax should not be
permitted in deduction guides.</P>

<P><B>Proposed resolution (approved by CWG 2023-05-12):</B></P>

<P>Change in 13.7.2.3 [<A href="https://wg21.link/temp.deduct.guide#3">temp.deduct.guide</A>] paragraph 3 as follows:</P>

<BLOCKQUOTE>

The same restrictions apply to the <I>parameter-declaration-clause</I>
of a deduction guide as in a function declaration
(9.3.4.6 [<A href="https://wg21.link/dcl.fct">dcl.fct</A>])<INS>, except that a generic parameter
type placeholder (9.2.9.7 [<A href="https://wg21.link/dcl.spec.auto">dcl.spec.auto</A>]) shall not appear in
the <I>parameter-declaration-clause</I> of a deduction guide</INS>.
The <I>simple-template-id</I> shall name a class template
specialization. The <I>template-name</I> shall be the same identifier
as the <I>template-name</I> of
the <I>simple-template-id</I>. A <I>deduction-guide</I> shall inhabit
the scope to which the corresponding class template belongs and, for a
member class template, have the same access. Two deduction guide
declarations for the same class template shall not have
equivalent <I>parameter-declaration-clause</I>s if either is reachable
from the other.

</BLOCKQUOTE>

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