This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
libjava doesn't build with new cp/*
- From: Michael Matz <matz at suse dot de>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 4 Sep 2003 18:09:38 +0200 (CEST)
- Subject: libjava doesn't build with new cp/*
Hi,
since the removal of the cast-as-lvalue extension with
2003-09-04 Mark Mitchell <mark@codesourcery.com>
Remove cast-as-lvalue extension.
* call.c (build_conditional_expr): Correct formatting.
...
libjava (gnu/java/awt/natEmbeddedWindow.cc) doesn't compile anymore due
to:
natEmbeddedWindow.cc:16: error: ISO C++ forbids cast to non-reference type
used as lvalue
The error message is correct, because this function reads:
void
gnu::java::awt::EmbeddedWindow::setWindowPeer
(gnu::java::awt::peer::EmbeddedWindowPeer* w)
{
if (!peer)
(::java::lang::Object*) peer = (::java::lang::Object*) w;
}
the 'peer' member has type '::java::awt::peer::ComponentPeer *' which has
no relation to 'gnu::java::awt::peer::EmbeddedWindowPeer*', so just
removing the casts doesn't work. Also just removing the left cast doesn't
work as ::java::lang::Object* can't be converted automatically to
::java::awt::peer::ComponentPeer*. Given this non-relation of the
involved types I have no idea how this is supposed to work.
But I know, that it breaks bootstrap of HEAD.
Ciao,
Michael.