Code: template<class Z> class A1{ protected : Z u; public: A1(Z pu):u(pu){} Z getU(){return u;} }; template <class Z> class A2:public A1<Z>{ public: A2(Z pu):A1<Z>(pu){}; Z nothing(){return u;} }; In a normal class u is defined in this scope , but in a template is not . as protected shouldn't be visible within A2? what is wrong