<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 565</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="565"></A><H4>565.
  
Conflict rules for <I>using-declaration</I>s naming function templates
</H4>
<B>Section: </B>9.10&#160; [<A href="https://wg21.link/namespace.udecl">namespace.udecl</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Paolo Carlini
 &#160;&#160;&#160;

 <B>Date: </B>9 March 2006<BR>


<P>[Voted into the WP at the February, 2012 meeting;
moved to DR at the October, 2012 meeting.]</P>



<P>The Standard does not appear to specify what happens for code like the
following:</P>

<PRE>
    namespace one {
      template&lt;typename T&gt; void fun(T);
    }

    using one::fun;

    template&lt;typename T&gt; void fun(T);
</PRE>

<P>9.10 [<A href="https://wg21.link/namespace.udecl#13">namespace.udecl</A>] paragraph 13 does not appear to apply
because it deals only with functions, not function templates:</P>

<BLOCKQUOTE>

If a function declaration in namespace scope or block scope has the
same name and the same parameter types as a function introduced by a
<I>using-declaration</I>, and the declarations do not declare the same
function, the program is ill-formed.

</BLOCKQUOTE>

<P>
<U>John Spicer</U>: For function templates I believe the rule
should be that if they have the same function type (parameter types
and return type) and have identical template parameter lists, the
program is ill-formed.</P>

<P><B>Proposed resolution (August, 2011):</B></P>

<P>Change 9.10 [<A href="https://wg21.link/namespace.udecl#14">namespace.udecl</A>] paragraph 14 as follows:</P>

<BLOCKQUOTE>

If a function declaration in namespace scope or block scope has the
same name and the same <DEL>parameter types</DEL>
<INS>parameter-type-list (9.3.4.6 [<A href="https://wg21.link/dcl.fct">dcl.fct</A>])</INS> as a
function introduced by a <I>using-declaration</I>, and the
declarations do not declare the same function, the program is
ill-formed. <INS>If a function template declaration in namespace
scope has the same name, parameter-type-list, return type, and
template parameter list as a function template introduced by a
<I>using-declaration</I>, the program is ill-formed.</INS>
[<I>Note:</I> Two <I>using-declaration</I>s may introduce functions
with the same name and the same <DEL>parameter types</DEL>
<INS>parameter-type-list</INS>. If, for a call to an unqualified
function name, function overload resolution selects the functions
introduced by such <I>using-declaration</I>s, the function call is
ill-formed. [<I>Example:</I>...

</BLOCKQUOTE>

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