This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ language lawyer question


On Monday, September 29, 2003, at 04:29 PM, Bruce Stephens wrote:
Gerald Pfeifer <gerald@pfeifer.com> writes:

[...]

...and if the "invited" friend is a member of a class, it must not
be private or protected.  This is the difference between GCC 3.3 and
3.4.

Ah, I see. Interesting question: can one bestow friendship on a private or protected member. Yes, that requires a language lawyer. I've got the standard, but I'm not sure I'd be able to work out the answer from it.

The standard is extremely simplistic wrt access control... I don't see anything hard about it. :-)


You can't access things, unless you have been declared a friend, or, the stuff is public. What can't you access, everything, types, members... The code in question violates that simple clause, and the answer to how to make it work, is contained in that one clause.

The hard part, is realizing that g++ has historically been too lax and permitted things it should not have.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]