This is the mail archive of the gcc-bugs@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]

[Bug c++/11952] REGRESSION: friend declaration handled as function call concerning access.


------- Additional Comments From victor dot judin at materna dot de  2004-08-27 09:01 -------
(In reply to comment #1)
> Sorry,... this is not a bug it seems.
> 
> According to the standard [class.friend] 11.4 Friends
> 7 A name nominated by a friend declaration shall be accessible in the scope of
> the class containing the friend declaration. The meaning of the friend
> declaration is the same whether the friend declaration appears in the private,
> protected or public (9.2) portion of the class member-specification.

Sorry, that's totally idiotic.
If I have 
class A
{
 void f();
public: 
 A();
~A();
};
and 
class B
{
//...
friend class A();
};
the visibility of A::f() remains private.
The sentence you mentioned above applies to the access of B's members from A and
is NOT about the access of A's members from B!!!
The sentence

>The meaning of the friend declaration is the same whether the friend
>declaration appears in the
>private, protected or public (9.2) portion of the class memberspecification.

means that the place where the declaration of friend ccurs is of no importance -
be it in public, private or proteced section of the class.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11952


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