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

            Bug ID: 48260
           Summary: Unexpected "address of overloaded function 'f' is
                    ambiguous" error for overloaded variadic template
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangb...@nondot.org
          Reporter: dpho...@gmail.com
                CC: blitzrak...@gmail.com, dgre...@apple.com,
                    erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
                    richard-l...@metafoo.co.uk

The following program compiles successfully on GCC and MSVC:


template<typename X, typename... Y>
void f(X&&, Y&&...)
{
}

template<typename X>
void f(X&&, const double&)
{
}

int main()
{
    void(*fptr)(const int&, const double&) = &f;
}


Using Clang (https://godbolt.org/z/5jE18P) we get:

<source>:13:46: error: address of overloaded function 'f' is ambiguous
    void(*fptr)(const int&, const double&) = &f;
                                             ^

This seems to affect all Clang versions. Tested on trunk, 11.0.0 and 3.0.0.

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

Reply via email to