https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69205
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Note the trunk has a different error message: t.cc: In function ‘int main(int, char**)’: t.cc:12:30: error: no matching function for call to ‘print_action(function<string*(int, string)>&)’ print_action<string, int>(t); ^ t.cc:6:6: note: candidate: template<class ActionType, class ... Cols> void print_action(function<ActionType*(Cols ..., ActionType)>) void print_action(function<ActionType*(Cols..., ActionType)> action_factory) ^~~~~~~~~~~~ t.cc:6:6: note: template argument deduction/substitution failed: t.cc:12:30: note: mismatched types ‘string’ and ‘int’ print_action<string, int>(t); ^ t.cc:13:17: error: no matching function for call to ‘print_action(function<string*(int, string)>&)’ print_action(t); ^ t.cc:6:6: note: candidate: template<class ActionType, class ... Cols> void print_action(function<ActionType*(Cols ..., ActionType)>) void print_action(function<ActionType*(Cols..., ActionType)> action_factory) ^~~~~~~~~~~~ t.cc:6:6: note: template argument deduction/substitution failed: t.cc:13:17: note: deduced conflicting types for parameter ‘ActionType’ (‘string’ and ‘int’) print_action(t); ^