https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105796
Bug ID: 105796 Summary: error: no matching function for call with template function Product: gcc Version: 12.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hiraditya at msn dot com Target Milestone: --- test.cpp ``` int func(int, char); template<typename... TArgs> int testFunc(int (*)(TArgs..., char)); int x = testFunc<int>(func); ``` With gcc trunk: g++ -std=c++20 test.cpp -c <source>:6:22: error: no matching function for call to 'testFunc<int>(int (&)(int, char))' 6 | int x = testFunc<int>(func); | ~~~~~~~~~~~~~^~~~~~ <source>:4:5: note: candidate: 'template<class ... TArgs> int testFunc(int (*)(TArgs ..., char))' 4 | int testFunc(int (*)(TArgs..., char)); | ^~~~~~~~ <source>:4:5: note: template argument deduction/substitution failed: <source>:6:22: note: mismatched types 'char' and 'int' 6 | int x = testFunc<int>(func); | ~~~~~~~~~~~~~^~~~~~ Compiler returned: 1