https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64194
--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> --- Slightly different testcase from PR 69620 which is probably the same issue: struct function { template<typename F> function(F); }; template <typename T1, typename T2> auto sum(T1 x, T2 y) { return x + y; } template <typename T1, typename T2, typename... Targ> auto sum(T1 x, T2 y, Targ... args) { return sum(x + y, args...); } int main() { //(void)sum<int, int, int>; function f = sum<int, int, int>; } ded.cc: In function 'int main()': ded.cc:21:18: error: conversion from '<unresolved overloaded function type>' to non-scalar type 'function' requested function f = sum<int, int, int>; ^~~~~~~~~~~~~~~~~~ It works if the function is instantiated first by uncommenting the first line in main.