<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 239</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="239"></A><H4>239.
  
Footnote 116 and Koenig lookup
</H4>
<B>Section: </B>12.2.2.2.2&#160; [<A href="https://wg21.link/over.call.func">over.call.func</A>]
 &#160;&#160;&#160;

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

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

 <B>Date: </B>2 Aug 2000<BR>


<P>[Moved to DR at 4/01 meeting.]</P>



In describing non-member functions in an overload set, footnote
116 (12.2.2.2.2 [<A href="https://wg21.link/over.call.func">over.call.func</A>]) says,

<BLOCKQUOTE>

Because of the usual name hiding rules, these will be introduced by
declarations or by <i>using-directive</i>s all found in the same block
or all found at namespace scope.

</BLOCKQUOTE>

<P>At least in terms of the current state of the Standard, this
is not correct: a block extern declaration does not prevent
Koenig lookup from occurring.  For example,</P>

<PRE>
    enum E { zero };
    void f(E);
    void g() {
        void f(int);
        f(zero);
    }
</PRE>

<P>In this example, the overload set will include declarations
from both namespace and block scope.</P>

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

<P><B>Proposed resolution (04/01):</B></P>

<OL>

<LI>
<P>In 6.5.4 [<A href="https://wg21.link/basic.lookup.argdep#2">basic.lookup.argdep</A>] paragraph 2, change</P>

<BLOCKQUOTE>

If the ordinary unqualified lookup of the name finds the declaration
of a class member function, the associated namespaces and classes are
not considered.

</BLOCKQUOTE>

<P>to</P>

<BLOCKQUOTE>

If the ordinary unqualified lookup of the name finds the declaration
of a class member function, or a block-scope function declaration
that is not a <I>using-declaration</I>, the associated namespaces
and classes are not considered.

</BLOCKQUOTE>

<P>and change the example to:</P>

<PRE>
    namespace NS {
        class T { };
        void f(T);
        void g(T, int);
    }
    NS::T parm;
    void g(NS::T, float);
    int main() {
        f(parm);            // OK: calls NS::f
        extern void g(NS::T, float);
        g(parm, 1);         // OK: calls g(NS::T, float)
    }
</PRE>

</LI>

<LI>
<P>In 12.2.2.2.2 [<A href="https://wg21.link/over.call.func#3">over.call.func</A>] paragraph 3 from:</P>

<BLOCKQUOTE>

If the name resolves to a non-member function declaration, that
function and its overloaded declarations constitute the set of
candidate functions.

</BLOCKQUOTE>

<P>to</P>

<BLOCKQUOTE>

If the name resolves to a set of non-member function declarations,
that set of functions constitutes the set of candidate functions.

</BLOCKQUOTE>

<P>Note that this text is also edited by <A HREF="364.html">issue 364</A>.
Also, remove the associated footnote 116.
</P>

</LI>

</OL>

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