◄Up► ◄Contents► ◄Index► ◄Back► ──────────────────────────────────────────────────────────────────────────── Compiler error C2604 cannot declare 'modifier' access to 'modifier' member 'class::identifier' The access declaration of the given identifier specified an access that was different from the access declared in the base class or structure. An access declaration may not restrict access to a member that is accessible in a base class, nor may it grant more access to a member of the base class, beyond that which already it already has. The following example shows illegal access declarations: struct X { private: int priv; protected: int prot; public: int pub; }; struct A : public X { protected: X::priv; // error X::pub; // error public: X::priv; // error X::prot; // error }; struct B : protected X { protected: X::priv; // error X::pub; // error public: X::priv; // error X::prot; // error }; struct C : private X { protected: X::priv; // error X::pub; // error public: X::priv; // error X::prot; // error }; -♦-