'identifier' is private within this context

Rupert Wood me@rupey.net
Thu Jan 17 01:42:00 GMT 2002


Kevin Hise wrote:

> I'm attempting to access a static variable from a static method,
> both members of the same class, both declared 'private', but
> declaring the variable and the method anything other than 'public'
> will cause g++ to barf a message saying the variable, function, or
> whatever is private / protected "within this context", like so:

Could you post some failing code? (Or, better still, a heavily
simplified version which still fails.) A trivial case constructed from
your description works OK and I can't see any obvious bugs in the
relevant bits of the C++ parser. Which version of g++?

Rup.



More information about the Gcc-help mailing list