libjava doesn't build with new cp/*

Michael Matz matz@suse.de
Thu Sep 4 16:20:00 GMT 2003


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.



More information about the Gcc mailing list