https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102034
Bug ID: 102034 Summary: template function signature incorrectly drops top-level cv-qualifiers of parameter from typedef-array of template-template Product: gcc Version: 10.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: nickhuang99 at hotmail dot com Target Milestone: --- Even the following snippet of code has similar root cause as PR101402 and PR102033, it cannot be easy fixed even with simple improvement of *resolve_typename_type*. It seems that we need a re-work of this function to correctly do recursion. template<class TA> struct A{ template<class TB> struct B{ typedef TB Arr3[3]; }; }; template<class TA, class TB> void f(const typename A<TA>::template B<TB>::Arr3){} template <> void f<int, char>(const typename A<int>::template B<char>::Arr3){} error: template-id 'f<int, char>' for 'void f(const char*)' does not match any template declaration 11 | void f<int, char>(const typename A<int>::template B<char>::Arr3){} | ^~~~~~~~~~~~ template-template.cpp:9:6: note: candidate is: 'template<class TA, class TB> void f(typename A<TA>::B<TB>::Arr3)' 9 | void f(const typename A<TA>::template B<TB>::Arr3){} | ^