[llvm-bugs] [Bug 34702] New: Address of variadic template function leads to type deduction failure

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Sep 22 05:52:12 PDT 2017


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

            Bug ID: 34702
           Summary: Address of variadic template function leads to type
                    deduction failure
           Product: clang
           Version: 5.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: matt at ookypooky.com
                CC: llvm-bugs at lists.llvm.org

This code:

--
template<typename... Ts>
void f (Ts... vs, int y);

auto p = &(f<>);
--

Fails to compile as follows:

--
$ clang++ -std=c++17 clang.cpp
clang.cpp:4:12: error: address of overloaded function 'f' does not match
required type 'void (int)'
auto p = &(f<>);
           ^~~
clang.cpp:2:6: note: candidate template ignored: failed template argument
deduction
void f (Ts... vs, int y);
     ^
1 error generated.
--

The code compiles fine in g++, FWIW. I don't see why it would be illegal, and
if it is illegal then the error message could do with being improved!

-- 
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/20170922/f1b028ef/attachment.html>


More information about the llvm-bugs mailing list