http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47765

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2011-09-08 
19:22:58 UTC ---
(In reply to comment #3)
> But another reasonable interpretation would be to skip the parameter
> during deduction and then let normal overload resolution check for the
> conversion; in that case deduction would fail for the first foo and so we 
> never
> check the conversion, so we don't try to instantiate A<char>.

But that breaks several libstdc++ tests, and this testcase:

template<typename ItT>
struct A {
        typedef typename ItT::value_t value_t;
};

template<typename T>
struct B {
        typedef T type_t;
};

template <class T, class... U>
typename A<T>::value_t f(int, T, U...);

template <class T>
T f(T, T);

void foo()
{
        B<char> b;
        f(b, b);
}

because then we do the substitution before checking whether B<char> can convert
to int.  I suppose that we could check conversion between deduction and
substitution...I think I'm going to raise this with the committee.

Reply via email to