https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101783
--- Comment #1 from nick huang <nickhuang99 at hotmail dot com> --- The following snippet of code and error gives more clear the issue. Considering: template<class T> struct A{ typedef T& Type; }; template<class T> void f(const typename A<T>::Type){} struct B{}; template <> void f<B>(const typename A<B>::Type){} generates following error: error: ‘const’ qualifiers cannot be applied to ‘A<B>::Type {aka B&}’ void f<B>(const typename A<B>::Type){} ^~~~ This would obviously confuses users about why *const* cannot be applied. Being unable to apply the *const* to *B&* SHOULD NOT be an error, instead it is merely a warning to be issued.