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++/10694] Befriending a function in a class that is only forward-declared


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From lerdsuwa@users.sourceforge.net  2003-05-27 15:19 -------
Subject: Re:  Befriending a function in a class that is only
 forward-declared

Wolfgang Bangerth wrote:

>>------- Additional Comments From lerdsuwa@gcc.gnu.org  2003-05-25 10:59 -------
>>I remove the regression marker in the summary
>>because this particular use of friend declaration
>>never works properly.  This is similar to a couple
>>other friend bugs I am working on.
>>
>
>Ah, wait a second -- the PR shows that this actually _did_ work in 3.2.3, 
>so it's definitely a regression. Now, if it's going to be fixed soon 
>anyway, I don't care so much, but otherwise I'd like to keep the marker.
>
Yes, it compiles, with no error displayed.  But it doesn't actually
grant a friendship.  In the testcase, there is a friend declaration

  template <class T> friend void Y<T>::member();

But if you try to access private/protected member from this function,
it will fail.  It's the issue whether we want to silently do the wrong
thing or issue a broken error message :)  I think an error message
at least tell the user something is wrong with the compiler.

--Kriang







------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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