https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78690
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Another testcase for this: struct C; template <typename T> struct A { struct C { static void bar (); }; }; template <typename T> struct B { using A<T>::C; void foo () { C.bar (); } };