[llvm-bugs] [Bug 48260] New: Unexpected "address of overloaded function 'f' is ambiguous" error for overloaded variadic template
via llvm-bugs
llvm-bugs at lists.llvm.org
Sun Nov 22 07:13:30 PST 2020
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: unassignedclangbugs at nondot.org
Reporter: dphoyes at gmail.com
CC: blitzrakete at gmail.com, dgregor at apple.com,
erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
richard-llvm at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201122/9bf18e87/attachment.html>
More information about the llvm-bugs
mailing list