https://gcc.gnu.org/bugzilla/show_bug.cgi?id=34810
--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Someone who has better understanding of the C++ standard should answer the question if this is valid or not because I don't understand all of the specific rules rules which are in play here. Especially when there has been some defect reports in this area before even. The question is: class B { }; class A: public B { A::B ab; // B is the inherited injected B }; typename A::A a; vs: class B { }; class A: public B { A::B ab; // B is the inherited injected B }; struct A::A a; CWG 318 clearifies the struct case but I don't see why typename would be handled here any different from struct case.