<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 357</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="357"></A><H4>357.
  
Definition of signature should include name
</H4>
<B>Section: </B>Clause 3&#160; [<A href="https://wg21.link/intro.defs">intro.defs</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Steve Clamage
 &#160;&#160;&#160;

 <B>Date: </B>26 May 2002<BR>


<P>[Voted into WP at April, 2007 meeting.]</P>



<P>Section Clause 3 [<A href="https://wg21.link/intro.defs">intro.defs</A>], definition of "signature"
omits the function name as part of the signature. Since the name participates
in overload resolution, shouldn't it be included in the definition?
I didn't find a definition of signature in the ARM,
but I might have missed it.</P>

<P>
<U>Fergus Henderson:</U>
I think so.  In particular, _N4140_.17.6.4.3.2 [<A href="https://wg21.link/global.names">global.names</A>]
reserves certain "function
signatures" for use by the implementation, which would be wrong
unless the signature includes the name.</P>
<BLOCKQUOTE>
<P>-2- Each global function signature declared with external linkage in a
header is reserved to the implementation to designate that function
signature with external linkage.</P>
<P>-5- Each function signature from the Standard C library declared with
external linkage is reserved to the implementation for use as a
function signature with both extern "C" and extern "C++" linkage,
or as a name of namespace scope in the global namespace.
</P>
</BLOCKQUOTE>
<P>Other uses of the term "function signature" in the description of the
standard library also seem to assume that it includes the name.</P>

<P>
<U>James Widman</U>: </P>

<P>Names don't participate in overload resolution; name lookup is
separate from overload resolution.  However, the word
&#8220;signature&#8221; is not used in Clause 12 [<A href="https://wg21.link/over">over</A>].
It <I>is</I> used in linkage and declaration matching (e.g.,
13.7.7.2 [<A href="https://wg21.link/temp.over.link">temp.over.link</A>]).  This suggests that the name
and scope of the function should be part of its signature.</P>

<P><B>Proposed resolution (October, 2006):</B></P>

<OL>

<LI>
<P>Replace Clause 3 [<A href="https://wg21.link/intro.defs">intro.defs</A>] &#8220;<INS>signature</INS>&#8221;
with the following:</P>
</LI>

<BLOCKQUOTE>

the name and the parameter-type-list (9.3.4.6 [<A href="https://wg21.link/dcl.fct">dcl.fct</A>])
of a function, as well as the class or namespace of which it is a
member.  If a function or function template is a class member its
signature additionally includes the <I>cv</I>-qualifiers (if any) on
the function or function template itself.  The signature of a function
template additionally includes its return type and its template
parameter list.  The signature of a function template specialization
includes the signature of the template of which it is a specialization
and its template arguments (whether explicitly specified or deduced).
[<I>Note:</I> Signatures are used as a basis for name-mangling and
linking.  &#8212;<I>end note</I>]

</BLOCKQUOTE>

<LI><P>Delete paragraph 3 and replace the first sentence of
13.7.7.2 [<A href="https://wg21.link/temp.over.link">temp.over.link</A>] as follows:</P></LI>

<BLOCKQUOTE>

<P><DEL>The signature of a function template specialization consists of the
signature of the function template and of the actual template
arguments (whether explicitly specified or deduced).</DEL></P>

<P>The signature of a function template <DEL>consists of its function
signature, its return type and its template parameter list</DEL> <INS>is
defined in Clause 3 [<A href="https://wg21.link/intro.defs">intro.defs</A>]</INS>. The names
of the template parameters are significant...</P>

</BLOCKQUOTE>

</OL>

<P>(See also <A HREF="537.html">issue 537</A>.)</P>

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