C/C++ Compiler (cl.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
C2604
                                             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
          };
                                    -♦-