<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 1446</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="1446"></A><H4>1446.
  
Member function with no <I>ref-qualifier</I> and non-member function with rvalue reference
</H4>
<B>Section: </B>13.7.7.3&#160; [<A href="https://wg21.link/temp.func.order">temp.func.order</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Jason Merrill
 &#160;&#160;&#160;

 <B>Date: </B>2012-02-07<BR>


<P>[Moved to DR at the November, 2014 meeting.]</P>

<P>A member function with no <I>ref-qualifier</I> can be called for a
class prvalue, as can a non-member function whose first parameter is an
rvalue reference to that class type.  However, 13.7.7.3 [<A href="https://wg21.link/temp.func.order">temp.func.order</A>]
does not handle this case.</P>

<P><B>Proposed resolution (February, 2014):</B></P>

<P>Change 13.7.7.3 [<A href="https://wg21.link/temp.func.order#3">temp.func.order</A>] paragraph 3 as follows:</P>

<BLOCKQUOTE>

...If only one of the function templates <INS><TT>M</TT></INS> is a
non-static member of some class <TT>A</TT>, <DEL>that function
template</DEL> <INS><TT>M</TT></INS> is considered to have a new first
parameter inserted in its function parameter list. Given <I>cv</I> as the
cv-qualifiers of <DEL>the function template</DEL> <INS><TT>M</TT></INS> (if
any), the new parameter is of type &#8220;rvalue reference
to <I>cv</I> <TT>A</TT>&#8221; if the optional <I>ref-qualifier</I>
of <DEL>the function template</DEL> <INS><TT>M</TT></INS>
is <TT>&amp;&amp;</TT><DEL>,</DEL> or <INS>if <TT>M</TT> has
no <I>ref-qualifier</I> and the first parameter of the other template has
rvalue reference type. Otherwise, the new parameter is</INS> of type
&#8220;lvalue reference to <I>cv</I>
<TT>A</TT>&#8221; <DEL>otherwise</DEL>. [<I>Note:</I> This allows a
non-static member to be ordered with respect to a nonmember function and
for the results to be equivalent to the ordering of two equivalent
nonmembers. &#8212;<I>end note</I>] [<I>Example:</I>...

</BLOCKQUOTE>

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