https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99963

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |ppalka at gcc dot gnu.org
   Target Milestone|---                         |11.0
            Summary|[concepts] template         |[11 Regression] [concepts]
                   |<concept> vs concept auto   |template <concept> vs
                   |reports ambiguous overload  |concept auto reports
                   |                            |ambiguous overload

--- Comment #1 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Started with r11-1571.  Reduced testcase that replaces the abbreviated function
templates with their corresponding non-abbreviated forms:

template <class T> concept C1 = true;
template <class T> concept C2 = C1<T> && true;

template <C1 T, C1 U> int f(T, U);
template <C1 T, C2 U> int f(U, T);

int x = f(0, 0); // error: ambiguous call


If I understand the wording of P2113 correctly:

  If deduction against the other template succeeds for both transformed
templates, constraints can be considered as follows:
  - ... if the corresponding template-parameters of the
template-parameter-lists are not equivalent ([temp.over.link]) or if the
function parameters that positionally correspond between the two templates are
not of the same type, neither template is more specialized than the other

then I think we're correct to reject the call as ambiguous because although the
second overload is more constrained than the first, their function parameter
lists aren't equivalent.

Reply via email to