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

            Bug ID: 67426
           Summary: Ambiguous overload between different function
                    templates, where one has non-deduced arg
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: barry.revzin at gmail dot com
  Target Milestone: ---

Consider this example (also in SO question
http://stackoverflow.com/q/32335523/2069064):

#include <utility>

template <int N>
using size_ = std::integral_constant<int, N>; 

// (1)
template <int From>
void f(size_<From>, size_<From+1> )
{ }

// (2)
template <int From, int To>
void f(size_<From>, size_<To> )
{ }

int main()
{
    f(size_<0>{}, size_<1>{});
}

gcc 5.2 declares this call ambiguous. Deduction from (1) to (2) succeeds
easily, should deduction from (2) to (1) not fail?

Reply via email to