GCC 3.4.3 and fiend decleration.

Georg Grabler ggrabler@gmail.com
Mon Dec 27 13:52:00 GMT 2004


Hello everybody.

First of all i'm sorry to post to this list, but it seems as if it was the 
only list read by some people.

I've a problem with a code as follows:
class a
{
protected:
virtual int f() const;
};

class b
{
friend int a::f() const;  // error - a::f() is protected and inaccessable
};

It worked on prior versions of GCC (according to people in my company), and 
i've found several postings on the web about this topic.

What i'd like to know is:
Will this be the same for future versions of GCC? What else could i use for 
this?

I've had a similar piece of code out of Stroustrups c++ "bible"... 

Thank you,
Grabler Georg



More information about the Gcc mailing list