This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix C++ friend usage in libjava
- From: Kriang Lerdsuwanakij <lerdsuwa at users dot sourceforge dot net>
- To: gcc-patches at gcc dot gnu dot org, java-patches at gcc dot gnu dot org
- Date: Mon, 25 Oct 2004 17:50:05 +0700
- Subject: [PATCH] Fix C++ friend usage in libjava
Hi
While I work on making C++ friend class behavior standard-conformance,
I discover some problems in libjava friend usage inside class
'java::lang::Class', for example, in the declaration
'friend class _Jv_ClassReader;'. The referred '_Jv_ClassReader' should
be in 'java::lang' namespace but the current g++ treats it as in
the global namespace.
This is fixed by specifying the global namespace explicitly as the
'_Jv_ClassReader' and other classes are actually in the global namespace.
This works with both current g++ and the upcoming one with correct
friend behavior.
(Note that the friend function here will need to be fixed eventually but
now g++ still has problem using friend functions from a different
namespace.)
Tested on i686-pc-linux-gnu. OK for the mainline?
--Kriang
2004-10-25 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
* libjava/java/lang/Class.h
(java::lang::Class): Correct friend class declaration.
Attachment:
diff-java-friend
Description: application/java-vm