<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 2918</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="2918"></A><H4>2918.
  
Consideration of constraints for address of overloaded function
</H4>
<B>Section: </B>12.3&#160; [<A href="https://wg21.link/over.over">over.over</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2024-06-26<BR>


<P>[Accepted as a DR at the November, 2024 meeting.]</P>



<P>Consider:</P>

<PRE>
  template&lt;bool B&gt; struct X {
    void f(short) requires B;
    void f(long);
    template&lt;typename&gt; void g(short) requires B;
    template&lt;typename&gt; void g(long);
   };
   void test(X&lt;true&gt; x) {
    x.f(0);           //<SPAN CLASS="cmnt"> #1, ambiguous</SPAN>
    x.g&lt;int&gt;(0);      //<SPAN CLASS="cmnt"> #2, ambiguous</SPAN>
    &amp;X&lt;true&gt;::f;      //<SPAN CLASS="cmnt"> #3, OK!</SPAN>
    &amp;X&lt;true&gt;::g&lt;int&gt;; //<SPAN CLASS="cmnt"> #4, ambiguous</SPAN>
  }
</PRE>

<P>For the function call cases, 12.2.4.1 [<A href="https://wg21.link/over.match.best.general#2.6">over.match.best.general</A>] bullet 2.6 and 13.7.7.3 [<A href="https://wg21.link/temp.func.order#6">temp.func.order</A>] paragraph 6 specify that
constraints are only considered if the competing overloads are
otherwise basically the same.  There is no corresponding restriction
when taking the address of a function.</P>

<P>For a second issue, the treatment of placeholder type deduction is
unclear:</P>

<PRE>
  template&lt;bool B&gt; struct X {
    void f(short) requires B;
    void f(short);
    template&lt;typename&gt; void g(short) requires B;
    template&lt;typename&gt; void g(short);
  };
  void test(X&lt;true&gt; x) {
    auto r = &amp;X&lt;true&gt;::f;       //<SPAN CLASS="cmnt"> #5</SPAN>
    auto s = &amp;X&lt;true&gt;::g&lt;int&gt;;  //<SPAN CLASS="cmnt"> #6</SPAN>
  }
</PRE>

<P>When the address of the overload set is resolved, there is a
target, but the target type is <TT>auto</TT>, which is not properly
handled.</P>

<P>See also <A HREF="2572.html">issue 2572</A>.</P>

<P><B>Proposed resolution (September, 2024) [SUPERSEDED]:</B></P>

<OL>
<LI>
<P>Change in 12.2.4.1 [<A href="https://wg21.link/over.match.best.general#2.6">over.match.best.general</A>] bullet 2.6 as follows:</P>

<BLOCKQUOTE>

<UL>
<LI>F1 and F2 are non-template functions and <INS>F1 is more
partial-ordering-constrained than F2
(13.5.5 [<A href="https://wg21.link/temp.constr.order">temp.constr.order</A>])</INS>
<UL class="del">
<LI>they have the same non-object-parameter-type-lists
(9.3.4.6 [<A href="https://wg21.link/dcl.fct">dcl.fct</A>]), and</LI>
<LI>if they are member
functions, both are direct members of the same class, and</LI>
<LI>if
both are non-static member functions, they have the same types for
their object parameters, and</LI>
<LI>F1 is more constrained than F2
according to the partial ordering of constraints described in
13.5.5 [<A href="https://wg21.link/temp.constr.order">temp.constr.order</A>],</LI>
</UL>
or if not that,
</LI>
</UL>

</BLOCKQUOTE>
</LI>

<LI>
<P>Change in 12.3 [<A href="https://wg21.link/over.over#1">over.over</A>] paragraph 1 as follows:</P>

<BLOCKQUOTE>

... The target can be
<UL>
<LI>an object or reference being initialized
(9.5 [<A href="https://wg21.link/dcl.init">dcl.init</A>], 9.5.4 [<A href="https://wg21.link/dcl.init.ref">dcl.init.ref</A>],
9.5.5 [<A href="https://wg21.link/dcl.init.list">dcl.init.list</A>]),</LI>
<LI>the left side of an assignment (7.6.19 [<A href="https://wg21.link/expr.assign">expr.assign</A>]),</LI>
<LI>a parameter of a function (7.6.1.3 [<A href="https://wg21.link/expr.call">expr.call</A>]),</LI>
<LI>a parameter of a user-defined operator
(12.4 [<A href="https://wg21.link/over.oper">over.oper</A>]),</LI>
<LI>the return value of a function,
operator function, or conversion (8.8.4 [<A href="https://wg21.link/stmt.return">stmt.return</A>]),</LI>
<LI>an explicit type conversion (7.6.1.4 [<A href="https://wg21.link/expr.type.conv">expr.type.conv</A>],
7.6.1.9 [<A href="https://wg21.link/expr.static.cast">expr.static.cast</A>], 7.6.3 [<A href="https://wg21.link/expr.cast">expr.cast</A>]), or</LI>
<LI>a
non-type <I>template-parameter</I> (13.4.3 [<A href="https://wg21.link/temp.arg.nontype">temp.arg.nontype</A>]).</LI>
</UL>

<INS>If the target type contains a placeholder type, placeholder type
deduction is performed (9.2.9.7.2 [<A href="https://wg21.link/dcl.type.auto.deduct">dcl.type.auto.deduct</A>]), and the
remainder of this subclause uses the target type so deduced.
</INS>

</BLOCKQUOTE>
</LI>

<LI>
<P>Change in 12.3 [<A href="https://wg21.link/over.over#5">over.over</A>] paragraph 5 as follows:</P>

<BLOCKQUOTE>

All functions with associated constraints that are not satisfied
(13.5.3 [<A href="https://wg21.link/temp.constr.decl">temp.constr.decl</A>]) are eliminated from the set of selected
functions. If more than one function in the set remains, all function
template specializations in the set are eliminated if the set also
contains a function that is not a function template
specialization. Any given non-template function F0 is eliminated if
the set contains a second non-template function that is more
<DEL>constrained</DEL> <INS>partial-ordering-constrained</INS> than F0
<DEL>according to the partial ordering rules of</DEL>
<INS>(</INS>13.5.5 [<A href="https://wg21.link/temp.constr.order">temp.constr.order</A>]<INS>)</INS>. Any given
function template specialization F1 is eliminated if the set contains
a second function template specialization whose function template is
more specialized than the function template of F1 according to the
partial ordering rules of 13.7.7.3 [<A href="https://wg21.link/temp.func.order">temp.func.order</A>]. After such
eliminations, if any, there shall remain exactly one selected
function.

</BLOCKQUOTE>
</LI>

<LI>
<P>Split and change in 12.3 [<A href="https://wg21.link/over.over#6">over.over</A>] paragraph 6 as follows:</P>

<BLOCKQUOTE>
<P>[Example 1: ...</P>

<P>The initialization of pfe is ill-formed because no f() with type
int(...) has been declared, and not because of any ambiguity. <DEL>For
another example,</DEL> <INS>-- end example]</INS>
</P>

<P class="ins">[Example:</P>

<P>...</P>

<P>-- end example]</P>

<P class="ins">[Example:</P>

<PRE class="ins">
  template&lt;bool B&gt; struct X {
    void f(short) requires B;
    void f(long);
    template&lt;typename&gt; void g(short) requires B;
    template&lt;typename&gt; void g(long);
  };
  void test() {
    &amp;X&lt;true&gt;::f;      //<SPAN CLASS="cmnt"> error: ambiguous; constraints are not considered</SPAN>
    &amp;X&lt;true&gt;::g&lt;int&gt;; //<SPAN CLASS="cmnt"> error: ambiguous; constraints are not considered</SPAN>
  }
</PRE>

<P class="ins">-- end example]</P>
</BLOCKQUOTE>
</LI>

<LI>
<P>Add a paragraph at the end of 13.5.5 [<A href="https://wg21.link/temp.constr.order">temp.constr.order</A>]:</P>

<BLOCKQUOTE>

<P>A declaration D1 is more constrained than another declaration D2 when
D1 is at least as constrained as D2, and D2 is not at least as
constrained as D1. [ Example: ... ]</P>

<P class="ins">
A non-template function F1 is more <I>partial-ordering-constrained</I>
than a non-template function F2 if
<UL class="ins">
<LI>they have the same non-object-parameter-type-lists
(9.3.4.6 [<A href="https://wg21.link/dcl.fct">dcl.fct</A>], and</LI>
<LI>if they are member functions, both are direct members of the same class, and</LI>
<LI>if both are non-static member functions, they have the same types for their object parameters, and</LI>
<LI>the declaration of F1 is more constrained than the declaration of F2.</LI>
</UL>
</P>

</BLOCKQUOTE>
</LI>

<LI>
<P>Change in 13.10.3.2 [<A href="https://wg21.link/temp.deduct.call#6">temp.deduct.call</A>] paragraph 6 as follows:</P>

<BLOCKQUOTE>

When P is a function type, function pointer type, or
pointer-to-member-function type:
<UL>
<LI>If the argument is an overload set containing one or more function
templates, the parameter is treated as a non-deduced context.</LI>
<LI>If the argument is an overload set (not containing function
templates), trial argument deduction is attempted using each of the
members of the set. <DEL>If deduction succeeds for only one of the
overload set members, that member is used as the argument value for
the deduction. If deduction succeeds for more than one member of the
overload set</DEL>
<INS>If all successful deductions yield the same deduced A, that
deduced A is the result of deduction; otherwise,</INS> the parameter
is treated as a non-deduced context.
</LI>
</UL>

</BLOCKQUOTE>
</LI>

<LI>
<P>Add a new paragraph at the end of 13.10.3.2 [<A href="https://wg21.link/temp.deduct.call">temp.deduct.call</A>] as follows:</P>

<BLOCKQUOTE class="ins">
[ Example:
<PRE>
  // <SPAN CLASS="cmnt">All arguments for placeholder type deduction (9.2.9.7.2 [<A href="https://wg21.link/dcl.type.auto.deduct">dcl.type.auto.deduct</A>]) yield the same deduced type.</SPAN>
  template&lt;bool B&gt; struct X {
    void f(short) requires B;   // #1
    void f(short);              // #2
  };
  void test() {
    auto x = &amp;X&lt;true&gt;::f;       //<SPAN CLASS="cmnt"> OK, deduces </SPAN>void(*)(short)<SPAN CLASS="cmnt">, selects #1</SPAN>
    auto y = &amp;X&lt;false&gt;::f;       //<SPAN CLASS="cmnt"> OK, deduces </SPAN>void(*)(short)<SPAN CLASS="cmnt">, selects #2</SPAN>
  }
</PRE>
-- end example]
</BLOCKQUOTE>
</LI>

<LI>
<P>Change in 13.10.3.6 [<A href="https://wg21.link/temp.deduct.type#5.6">temp.deduct.type</A>] bullet 5.6 as follows:</P>

<BLOCKQUOTE>

<UL>
<LI>A function parameter for which the associated argument is an overload
set <DEL>(12.3 [<A href="https://wg21.link/over.over">over.over</A>])</DEL>, and one or more of the following
apply:
<UL>
<LI>
<DEL>more than one function matches</DEL> <INS>functions that do
not all have the same function type match</INS> the function parameter
type (resulting in an ambiguous deduction), or</LI>
<LI>no function matches the function parameter type, or</LI>
<LI>the overload set supplied as an argument contains one or more
function templates.
</LI>
</UL>
</LI>
</UL>

</BLOCKQUOTE>

</LI>

<LI>
<P>Add a section to C.1.5 [<A href="https://wg21.link/diff.cpp23.temp">diff.cpp23.temp</A>]:</P>

<BLOCKQUOTE class="ins">
<P>
Affected subclause: 13.10.3.2 [<A href="https://wg21.link/temp.deduct.call">temp.deduct.call</A>]<BR>
Change: Template argument deduction from overload sets succeeds in more cases.<BR>
Rationale: Allow consideration of constraints to disambiguate overload sets used as parameters in function calls.<BR>
Effect on original feature: Valid C++ 2023 code may become ill-formed.<BR>
[Example 1:
</P>
<PRE>
  template &lt;typename T&gt;
  void f(T &amp;&amp;, void (*)(T &amp;&amp;));

  void g(int &amp;);
  inline namespace A {
    void g(short &amp;&amp;);
  }
  inline namespace B {
    void g(short &amp;&amp;);
  }

  void q() {
    int x;
    f(x, g);         //<SPAN CLASS="cmnt"> ill-formed; previously well-formed, deducing </SPAN>T=int&amp;
  }
</PRE>
-- end example]
</BLOCKQUOTE>
</LI>
</OL>

<P><B>CWG 2024-09-27</B></P>

<P>Functions whose constraints are not satisfied should be excluded
from the overload set before attempting deduction.  Also, clarify that
12.3 [<A href="https://wg21.link/over.over">over.over</A>] applies after deduction is complete.</P>

<P><B>Proposed resolution (approved by CWG 2024-11-19):</B></P>

<OL>
<LI>
<P>Change in 12.2.4.1 [<A href="https://wg21.link/over.match.best.general#2.6">over.match.best.general</A>] bullet 2.6 as follows:</P>

<BLOCKQUOTE>

<UL>
<LI>F1 and F2 are non-template functions and <INS>F1 is more
partial-ordering-constrained than F2
(13.5.5 [<A href="https://wg21.link/temp.constr.order">temp.constr.order</A>])</INS>
<UL class="del">
<LI>they have the same non-object-parameter-type-lists
(9.3.4.6 [<A href="https://wg21.link/dcl.fct">dcl.fct</A>]), and</LI>
<LI>if they are member
functions, both are direct members of the same class, and</LI>
<LI>if
both are non-static member functions, they have the same types for
their object parameters, and</LI>
<LI>F1 is more constrained than F2
according to the partial ordering of constraints described in
13.5.5 [<A href="https://wg21.link/temp.constr.order">temp.constr.order</A>],</LI>
</UL>
or if not that,
</LI>
</UL>

</BLOCKQUOTE>
</LI>

<LI>
<P>Change in 12.3 [<A href="https://wg21.link/over.over#1">over.over</A>] paragraph 1 as follows:</P>

<BLOCKQUOTE>

... The target can be
<UL>
<LI>an object or reference being initialized
(9.5 [<A href="https://wg21.link/dcl.init">dcl.init</A>], 9.5.4 [<A href="https://wg21.link/dcl.init.ref">dcl.init.ref</A>],
9.5.5 [<A href="https://wg21.link/dcl.init.list">dcl.init.list</A>]),</LI>
<LI>the left side of an assignment (7.6.19 [<A href="https://wg21.link/expr.assign">expr.assign</A>]),</LI>
<LI>a parameter of a function (7.6.1.3 [<A href="https://wg21.link/expr.call">expr.call</A>]),</LI>
<LI>a parameter of a user-defined operator
(12.4 [<A href="https://wg21.link/over.oper">over.oper</A>]),</LI>
<LI>the return value of a function,
operator function, or conversion (8.8.4 [<A href="https://wg21.link/stmt.return">stmt.return</A>]),</LI>
<LI>an explicit type conversion (7.6.1.4 [<A href="https://wg21.link/expr.type.conv">expr.type.conv</A>],
7.6.1.9 [<A href="https://wg21.link/expr.static.cast">expr.static.cast</A>], 7.6.3 [<A href="https://wg21.link/expr.cast">expr.cast</A>]), or</LI>
<LI>a
non-type <I>template-parameter</I> (13.4.3 [<A href="https://wg21.link/temp.arg.nontype">temp.arg.nontype</A>]).</LI>
</UL>

<INS>If the target type contains a placeholder type, placeholder type
deduction is performed (9.2.9.7.2 [<A href="https://wg21.link/dcl.type.auto.deduct">dcl.type.auto.deduct</A>]), and the
remainder of this subclause uses the target type so deduced.
</INS>

</BLOCKQUOTE>
</LI>

<LI>
<P>Change in 12.3 [<A href="https://wg21.link/over.over#5">over.over</A>] paragraph 5 as follows:</P>

<BLOCKQUOTE>

All functions with associated constraints that are not satisfied
(13.5.3 [<A href="https://wg21.link/temp.constr.decl">temp.constr.decl</A>]) are eliminated from the set of selected
functions. If more than one function in the set remains, all function
template specializations in the set are eliminated if the set also
contains a function that is not a function template
specialization. Any given non-template function F0 is eliminated if
the set contains a second non-template function that is more
<DEL>constrained</DEL> <INS>partial-ordering-constrained</INS> than F0
<DEL>according to the partial ordering rules of</DEL>
<INS>(</INS>13.5.5 [<A href="https://wg21.link/temp.constr.order">temp.constr.order</A>]<INS>)</INS>. Any given
function template specialization F1 is eliminated if the set contains
a second function template specialization whose function template is
more specialized than the function template of F1 according to the
partial ordering rules of 13.7.7.3 [<A href="https://wg21.link/temp.func.order">temp.func.order</A>]. After such
eliminations, if any, there shall remain exactly one selected
function.

</BLOCKQUOTE>
</LI>

<LI>
<P>Split and change in 12.3 [<A href="https://wg21.link/over.over#6">over.over</A>] paragraph 6 as follows:</P>

<BLOCKQUOTE>
<P>[Example 1: ...</P>

<P>The initialization of pfe is ill-formed because no f() with type
int(...) has been declared, and not because of any ambiguity. <DEL>For
another example,</DEL> <INS>-- end example]</INS>
</P>

<P class="ins">[Example:</P>

<P>...</P>

<P>-- end example]</P>

<P class="ins">[Example:</P>

<PRE class="ins">
  template&lt;bool B&gt; struct X {
    void f(short) requires B;
    void f(long);
    template&lt;typename&gt; void g(short) requires B;
    template&lt;typename&gt; void g(long);
  };
  void test() {
    &amp;X&lt;true&gt;::f;      //<SPAN CLASS="cmnt"> error: ambiguous; constraints are not considered</SPAN>
    &amp;X&lt;true&gt;::g&lt;int&gt;; //<SPAN CLASS="cmnt"> error: ambiguous; constraints are not considered</SPAN>
  }
</PRE>

<P class="ins">-- end example]</P>
</BLOCKQUOTE>
</LI>

<LI>
<P>Add a paragraph at the end of 13.5.5 [<A href="https://wg21.link/temp.constr.order">temp.constr.order</A>]:</P>

<BLOCKQUOTE>

<P>A declaration D1 is more constrained than another declaration D2 when
D1 is at least as constrained as D2, and D2 is not at least as
constrained as D1. [ Example: ... ]</P>

<P class="ins">
A non-template function F1 is <I>more partial-ordering-constrained</I>
than a non-template function F2 if
<UL class="ins">
<LI>they have the same non-object-parameter-type-lists
(9.3.4.6 [<A href="https://wg21.link/dcl.fct">dcl.fct</A>], and</LI>
<LI>if they are member functions, both are direct members of the same class, and</LI>
<LI>if both are non-static member functions, they have the same types for their object parameters, and</LI>
<LI>the declaration of F1 is more constrained than the declaration of F2.</LI>
</UL>
</P>

</BLOCKQUOTE>
</LI>

<LI>
<P>Change in 13.10.3.2 [<A href="https://wg21.link/temp.deduct.call#6">temp.deduct.call</A>] paragraph 6 as follows:</P>

<BLOCKQUOTE>

When P is a function type, function pointer type, or
pointer-to-member-function type:
<UL>
<LI>If the argument is an overload set containing one or more function
templates, the parameter is treated as a non-deduced context.</LI>
<LI>If the argument is an overload set (not containing function
templates), trial argument deduction is attempted using each of the
members of the set <INS>whose associated constraints
(13.5.2 [<A href="https://wg21.link/temp.constr.constr">temp.constr.constr</A>]) are satisfied</INS>.
<DEL>If deduction succeeds for only one of the
overload set members, that member is used as the argument value for
the deduction. If deduction succeeds for more than one member of the
overload set</DEL>
<INS>If all successful deductions yield the same deduced A, that
deduced A is the result of deduction; otherwise,</INS> the parameter
is treated as a non-deduced context.
</LI>
</UL>

</BLOCKQUOTE>
</LI>

<LI>
<P>Add a new paragraph at the end of 13.10.3.2 [<A href="https://wg21.link/temp.deduct.call">temp.deduct.call</A>] as follows:</P>

<BLOCKQUOTE class="ins">
[ Example:
<PRE>
  // <SPAN CLASS="cmnt">All arguments for placeholder type deduction (9.2.9.7.2 [<A href="https://wg21.link/dcl.type.auto.deduct">dcl.type.auto.deduct</A>]) yield the same deduced type.</SPAN>
  template&lt;bool B&gt; struct X {
    static void f(short) requires B;   // #1
    static void f(short);              // #2
  };
  void test() {
    auto x = &amp;X&lt;true&gt;::f;       //<SPAN CLASS="cmnt"> OK, deduces </SPAN>void(*)(short)<SPAN CLASS="cmnt">, selects #1</SPAN>
    auto y = &amp;X&lt;false&gt;::f;       //<SPAN CLASS="cmnt"> OK, deduces </SPAN>void(*)(short)<SPAN CLASS="cmnt">, selects #2</SPAN>
  }
</PRE>
-- end example]
</BLOCKQUOTE>
</LI>

<LI>
<P>Change in 13.10.3.6 [<A href="https://wg21.link/temp.deduct.type#5.6">temp.deduct.type</A>] bullet 5.6 as follows:</P>

<BLOCKQUOTE>

<UL>
<LI>A function parameter for which the associated argument is an
overload set <DEL>(12.3 [<A href="https://wg21.link/over.over">over.over</A>]), and</DEL> <INS>such
that</INS> one or more of the following apply:
<UL>
<LI>
<DEL>more than one function matches</DEL> <INS>functions whose
associated constraints are satisfied and that do not all have the same
function type match</INS> the function parameter type (resulting in an
ambiguous deduction), or</LI>
<LI>no function <INS>whose associated constraints are satisfied</INS>
matches the function parameter type, or</LI>
<LI>the overload set supplied as an argument contains one or more
function templates.
</LI>
</UL>
<INS>[ Note: A particular function from the overload set is selected
(12.3 [<A href="https://wg21.link/over.over">over.over</A>]) after template argument deduction has
succeeded (13.10.4 [<A href="https://wg21.link/temp.over">temp.over</A>]). -- end note ]</INS>
</LI>
</UL>

</BLOCKQUOTE>

</LI>

<LI>
<P>Add a section to C.1.5 [<A href="https://wg21.link/diff.cpp23.temp">diff.cpp23.temp</A>]:</P>

<BLOCKQUOTE class="ins">
<P>
Affected subclause: 13.10.3.2 [<A href="https://wg21.link/temp.deduct.call">temp.deduct.call</A>]<BR>
Change: Template argument deduction from overload sets succeeds in more cases.<BR>
Rationale: Allow consideration of constraints to disambiguate overload sets used as parameters in function calls.<BR>
Effect on original feature: Valid C++ 2023 code may become ill-formed.<BR>
[Example 1:
</P>
<PRE>
  template &lt;typename T&gt;
  void f(T &amp;&amp;, void (*)(T &amp;&amp;));

  void g(int &amp;);              // <SPAN CLASS="cmnt">#1</SPAN>
  inline namespace A {
    void g(short &amp;&amp;);         // <SPAN CLASS="cmnt">#2</SPAN>
  }
  inline namespace B {
    void g(short &amp;&amp;);         // <SPAN CLASS="cmnt">#3</SPAN>
  }

  void q() {
    int x;
    f(x, g);         //<SPAN CLASS="cmnt"> ill-formed; previously well-formed, deducing </SPAN>T=int&amp;
  }
</PRE>
There is no change to the applicable deduction rules for the
individual <TT>g</TT> candidates: Type deduction from #1 does not
succeed; type deductions from #2 and #3 both succeed.  -- end
example]
</BLOCKQUOTE>
</LI>
</OL>

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