// PR c++/34950 template struct policy { typedef int unnecessary; }; template struct A { typedef int type; typedef typename Policy::unnecessary unused; }; template struct S { typedef int type; typedef typename A::type unused; }; template typename S::type foo(); template S >::type foo(); template int def(T); const int i = def(foo);