https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85498
Bug ID: 85498 Summary: Unable to resolve function name with inferred return type Product: gcc Version: 7.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: gcc at dcousens dot com Target Milestone: --- gcc version 7.3.1 20180312 (GCC) But, this fails on many different GCC versions. https://godbolt.org/g/G5gEx2 **Expected:** Compilation should succeed (like other compilers, MSVC, Clang, etc) **Actual:** Compilation failed ``` template<typename T> auto foo (T t) { return t; } template<typename T> void bar (const T) {} int main () { bar(foo<int>); } ``` Result: ``` <source>: In function 'int main()': <source>:10:17: error: no matching function for call to 'bar(<unresolved overloaded function type>)' bar(foo<int>); ^ <source>:7:6: note: candidate: template<class T> void bar(T) void bar (const T) {} ^~~ <source>:7:6: note: template argument deduction/substitution failed: <source>:10:17: note: couldn't deduce template parameter 'T' bar(foo<int>); ^ Compiler returned: 1 ```