This is the mail archive of the
java-patches@sourceware.cygnus.com
mailing list for the Java project.
Re: patch: gcc 2.96 compile fixes, file creation mode, ServerSocket bind cleanup
- To: tromey@cygnus.com, Java Patch List <java-patches@sourceware.cygnus.com>
- Subject: Re: patch: gcc 2.96 compile fixes, file creation mode, ServerSocket bind cleanup
- From: Bryce McKinlay <bryce@albatross.co.nz>
- Date: Wed, 04 Aug 1999 13:46:43 +1200
- References: <874sig39nv.fsf@cygnus.com>
Tom Tromey wrote:
> Bryce, can you send a bug report to gcc-bugs@egcs.cygnus.com?
> I'm having a hard time even getting the current egcs to build on my
> box.
Yeah, I was having build problems last night too. Seems to be building fine
again just now.
> I've appended a piece of code I think should fail. Can you test it?
> We ought to send them a self-contained test case if we can. So if my
> test doesn't show the bug, could you maybe look to see how it can be
> changed?
Your test case gives an internal compiler error trying to instantiate
java::lang::Object. I changed it a bit and now have something that gives the
same error that we're seeing in libgcj:
// Test java booleans and overloading
extern "Java"
{
typedef __java_boolean jboolean;
typedef __java_int jint;
typedef __java_short jshort;
namespace java
{
namespace lang
{
class Object;
class Class;
};
};
class Bar
{
Bar (jboolean b);
Bar (jshort j);
};
};
typedef class java::lang::Object* jobject;
typedef class java::lang::Class* jclass;
extern "C" jobject _Jv_AllocObject (jclass, jint);
class foo
{
Bar *x;
foo ()
{
x = new Bar (false);
x = new Bar (21);
}
};
[bryce@reason overload]$ gcc test.cc
test.cc: In method `foo::foo()':
test.cc:35: call of overloaded `Bar(bool)' is ambiguous
test.cc:20: candidates are: Bar::Bar(__java_boolean)
test.cc:21: Bar::Bar(__java_short)
test.cc:36: call of overloaded `Bar(int)' is ambiguous
test.cc:20: candidates are: Bar::Bar(__java_boolean)
test.cc:21: Bar::Bar(__java_short)
[ bryce ]