https://bugs.llvm.org/show_bug.cgi?id=47235

            Bug ID: 47235
           Summary: Overloaded template functions became ambiguous
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected],
                    [email protected]

Clang++ rejects the valid code as ambiguous, while g++ accepts:

$ cat s.C
template<typename T, typename U> void f(U&) { }
template<typename T, typename U> void f(T const&) { }
int main()
{
    int a;
    f<int, int const>(a);
}

$ clang++ -c s.C
s.C:6:5: error: call to 'f' is ambiguous
    f<int, int const>(a);
    ^~~~~~~~~~~~~~~~~
s.C:1:39: note: candidate function [with T = int, U = const int]
template<typename T, typename U> void f(U&) { }
                                      ^
s.C:2:39: note: candidate function [with T = int, U = const int]
template<typename T, typename U> void f(T const&) { }
                                      ^
1 error generated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to