This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/10694] Befriending a function in a class that is only forward-declared
- From: "lerdsuwa at users dot sourceforge dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 May 2003 15:19:18 -0000
- Subject: [Bug c++/10694] Befriending a function in a class that is only forward-declared
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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.