GCC 3.4.3 and fiend decleration.

Andrew Pinski pinskia@physics.uc.edu
Mon Dec 27 14:11:00 GMT 2004


On Dec 27, 2004, at 9:40 AM, Georg Grabler wrote:

> 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"...

Does not matter, this is invalid C++ (the standard which is the bible
really).

Thanks,
Andrew Pinski



More information about the Gcc mailing list