https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83542
--- Comment #1 from Barry Revzin <barry.revzin at gmail dot com> ---
This slightly different example:
template <typename... T>
struct list { };
template <typename... T, typename U>
void foo(list<T...>, list<U>, void(*)(T..., U))
{ }
void f(int, int) { }
int main()
{
foo(list<int>{}, list<int>{}, &f);
}
fails with a different error:
foo.cxx: In function ‘int main()’:
foo.cxx:13:37: error: no matching function for call to ‘foo(list<int>,
list<int>, void (*)(int, int))’
foo(list<int>{}, list<int>{}, &f);
^
foo.cxx:5:6: note: candidate: template<class ... T, class U> void foo(list<T
...>, list<U>, void (*)(T ..., U))
void foo(list<T...>, list<U>, void(*)(T..., U))
^~~
foo.cxx:5:6: note: template argument deduction/substitution failed:
foo.cxx:13:37: note: candidate expects 1 argument, 2 provided
foo(list<int>{}, list<int>{}, &f);
^