Private typedefs are accessible outside the class

Peter Nordlund petern@nada.kth.se
Wed Sep 23 00:51:00 GMT 1998


In egcs-1.1a such a typedef is accessible outside the class. 
In the SGI mipspro 7.20 compiler it is not.
I think that the mipspro compiler is right and egcs is wrong. 
(I guess it is known already, but there is nothing in the FAQ
about it)

class test {
  typedef int itype;
};
int main() {
  test::itype a; //OK with egcs,  error with mipspro:type "test::itype"
                 //is inaccessible.
  return 0;
}

//Peter



More information about the Gcc-bugs mailing list