https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71653
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rejects-valid --- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- If I don't use an alias template in the original declaration of f it works: template <typename T> using C = typename T::InnerType; template <typename T> typename T::InnerType f(T &); class S { using InnerType = int; template <typename T> friend C<T> f(T &); }; int main() { S s; f(s); return 0; }