<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 524</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="524"></A><H4>524.
  
Can function-notation calls to operator functions be dependent?
</H4>
<B>Section: </B>13.8.3&#160; [<A href="https://wg21.link/temp.dep">temp.dep</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Daveed Vandevoorde
 &#160;&#160;&#160;

 <B>Date: </B>19 July 2005<BR>


<P>[Voted into WP at the October, 2006 meeting.]</P>

<P>The description of dependent function calls in
13.8.3 [<A href="https://wg21.link/temp.dep#1">temp.dep</A>] paragraph 1 applies only to
<I>identifier</I>s in postfix-notation function calls and to operator
notation calls for operator functions:</P>

<BLOCKQUOTE>

<P>In an expression of the form:</P>

<UL>
<I>postfix-expression</I> <TT>(</TT> <I>expression-list<SUB>opt</SUB></I> <TT>)</TT>
</UL>

<P>where the <I>postfix-expression</I> is an <I>identifier</I>,
the <I>identifier</I> denotes a <I>dependent name</I> if and only if
any of the expressions in the <I>expression-list</I> is a
type-dependent expression (13.8.3.3 [<A href="https://wg21.link/temp.dep.expr">temp.dep.expr</A>]). If an
operand of an operator is a type-dependent expression, the operator
also denotes a dependent name.</P>

</BLOCKQUOTE>

<P>It would appear from the related passage in
13.8.4.2 [<A href="https://wg21.link/temp.dep.candidate#1">temp.dep.candidate</A>] paragraph 1 that the description of
postfix-notation function calls should apply to all
<I>unqualified-id</I>s that are not <I>template-id</I>s,
including <I>operator-function-id</I>s, not just to
<I>identifier</I>s:</P>

<BLOCKQUOTE>

For a function call that depends on a template parameter, if the
function name is an <I>unqualified-id</I> but not
a <I>template-id</I>, the candidate functions are found...

</BLOCKQUOTE>

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

<OL>
<LI><P>Change 13.8.3 [<A href="https://wg21.link/temp.dep#1">temp.dep</A>] paragraph 1 as
indicated:</P></LI>

<BLOCKQUOTE>

<P>...In an expression of the form:</P>

<UL>
<I>postfix-expression </I><TT>(</TT><I> expression-list<SUB>opt</SUB> </I><TT>)</TT>
</UL>

<P>where the <I>postfix-expression</I> is an <DEL><I>identifier</I></DEL>
<INS><I>unqualified-id</I> but not a <I>template-id</I></INS>,
the <DEL><I>identifier</I></DEL> <INS><I>unqualified-id</I></INS> denotes
a <I>dependent name</I> if and only if any of the expressions in
the <I>expression-list</I> is a type-dependent expression
(13.8.3.3 [<A href="https://wg21.link/temp.dep.expr">temp.dep.expr</A>])...</P>

</BLOCKQUOTE>

<LI><P>Change 13.8.4.2 [<A href="https://wg21.link/temp.dep.candidate#1">temp.dep.candidate</A>] paragraph 1 as
indicated:</P></LI>

<BLOCKQUOTE>

For a function call that depends on a template parameter, if the
function name is an <I>unqualified-id</I> but not
a <I>template-id</I>, <INS>or if the function is called using operator
notation,</INS> the candidate functions are found using the
usual lookup rules (6.5.3 [<A href="https://wg21.link/basic.lookup.unqual">basic.lookup.unqual</A>], 6.5.4 [<A href="https://wg21.link/basic.lookup.argdep">basic.lookup.argdep</A>]) except that...

</BLOCKQUOTE>

</OL>

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

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