Description of problem: === Console === ~/tmp$ g++-9.1.0 -c test.cpp test.cpp: In member function ‘void S<T>::bar()’: test.cpp:11:20: error: no matching function for call to ‘S<T>::foo<void>(int)’ 11 | foo<void>(1); | ^ test.cpp:5:17: note: candidate: ‘template<class T> template<class U, class V> static void S<T>::foo(V)’ 5 | static void foo(V) | ^~~ test.cpp:5:17: note: template argument deduction/substitution failed: test.cpp:11:20: note: mismatched types ‘V’ and ‘int’ 11 | foo<void>(1); | === Version-Release number of selected component (if applicable): latest How reproducible: === test.cpp === template <class T> struct S { template <class U, class V> static void foo(V) { } void bar() { foo<void>(1); } }; === Steps to Reproduce: 1.See above 2. 3. Actual results: See description Expected results: Additional info: This is reported upstream in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90505 and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92221 This also appears to be a regressiopn from a previous fix: https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=265734
Thanks for the report, I will restart my work on the fix next week (I'm on PTO today and Friday). Also fixing the component.
Fixed upstream: https://gcc.gnu.org/g:6b3302da9ef26aa11940f8c0dc92bec19e15c09b
Fixed in gcc 9 too: https://gcc.gnu.org/g:581825efc30ce79d86dfb0ebf378913fdec44adf
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2020:2274