Intel and Clang bugs with [temp.deduct.call]/4.3

Issue #526 new
Colin MacLean created an issue

#include <type_traits>

template<typename T>
struct A {};

template<typename T>
struct A<T[]> : A<T> {};

template<typename T>
void foo(T* a, A<T>& b) {}

template<typename T>
void bar(T* a, A<std::type_identity_t<T>>& b) {}

void test()
{
    int * t1;
    A<int> t2;
    A<int[]> t3;
    foo(t1,t2);
    foo(t1,t3); // GCC, MSVC: correctly errors on conflicting deductions for T: int and int[]
                // Clang, Intel: incorrectly calls foo(int*,A<int>). [temp.deduct.call]/5
                //    should only apply if deduction fails in isolation. Deduction is supposed
                //    to be done on each parameter separately. Only later should it be checked
                //    for conflicts.  Ambiguous deduction is not the same as failed deduction.
    bar(t1,t2);
    bar(t1,t3); // Compliant implicit cast for second argument, as T in the second
                //    argument becomes a dependent type rather than a deduced one.
}

https://github.com/llvm/llvm-project/issues/48864

Intel ticket #05025265

Comments (0)

  1. Log in to comment