public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* 'identifier' is private within this context
@ 2002-01-16 23:35 Kevin Hise
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Hise @ 2002-01-16 23:35 UTC (permalink / raw)
  To: gcc-help

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:

rapi.cpp:296: `static int RAPI::GetHostAddr(uint32_t *, const char *)' is 
private
rapi.cpp:437: within this context
rapi.h:271: `enum RAPI::SUSPEND_TYPE RAPI::SUSPEND_ENTER' is private
rapi.cpp:441: within this context
rapi.cpp:447: `sockList' undeclared (first use this function)
rapi.cpp:447: (Each undeclared identifier is reported only once
rapi.cpp:447: for each function it appears in.)
rapi.cpp:339: `static int RAPI::SocketOpen(unsigned int, unsigned int)' is 
private
rapi.cpp:458: within this context
rapi.h:263: `static struct RAPI::SockItem * RAPI::AddConnection(int, unsigned 
int, unsigned int, RAPI::SockItem::SOCKTYPE)' is private
rapi.cpp:468: within this context
rapi.cpp:411: `static void RAPI::SocketClose(int)' is private
rapi.cpp:473: within this context
rapi.h:272: `enum RAPI::SUSPEND_TYPE RAPI::SUSPEND_LEAVE' is private
rapi.cpp:490: within this context
rapi.cpp: In function `struct RAPI::SockItem * AddConnection(int, unsigned 
int, unsigned int, RAPI::SockItem::SOCKTYPE)':
rapi.cpp:22: `struct RAPI::SockItem * RAPI::sockList' is private
rapi.cpp:581: within this context
rapi.cpp:22: `struct RAPI::SockItem * RAPI::sockList' is private
rapi.cpp:582: within this context
make: *** [rapi.o] Error 1

What do I do?  Do I have to have all of my class members public now?

Scratching my head in the desert...
kevinh

^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: 'identifier' is private within this context
       [not found] <616BE6A276E3714788D2AC35C40CD18D30F74A@whale.softwire.co.uk>
@ 2002-01-17  1:42 ` Rupert Wood
  0 siblings, 0 replies; 2+ messages in thread
From: Rupert Wood @ 2002-01-17  1:42 UTC (permalink / raw)
  To: 'Kevin Hise'; +Cc: gcc-help

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-01-17  9:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-16 23:35 'identifier' is private within this context Kevin Hise
     [not found] <616BE6A276E3714788D2AC35C40CD18D30F74A@whale.softwire.co.uk>
2002-01-17  1:42 ` Rupert Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).