Try this: #include <gcj/javaprims.h> static void foo () { new jboolean[1]; } Compile with this: gcc-3.0 gccbug.cpp Results: gccbug.cpp: In function `void foo()': gccbug.cpp:5: Can't find class$ Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions. Release: 3.0.1-0pre0108 Environment: $ uname -a Linux server 2.2.19pre17 #1 Tue Mar 13 22:37:59 EST 2001 i686 unknown
Fix: no idea
State-Changed-From-To: open->analyzed State-Changed-Why: Not a bug. Please re-read the CNI documentation at http://gcc.gnu.org/java/papers/cni/t1.html to see how to create a Java array from C++. However, it would be nice if CNI did support this syntax. Possibly we can implement it with operator overloading. Changing category to libgcj and filing as change-request.
It would be nice for this feature but it still segfaults which is clearly a bug, I will file it seperately.
Please review the code. "new jboolean[1]" is _not_ attempting to create a new Java array, it should create a new C++ array (of one element, in this case) that happens to be of a Java primitive type, similar to "new short[1]". See C++ ARM sec. 5.3.3. This is a bug relating to ordinary C++, not a suggestion for clever integration with Java.
Andrew's report about the ICE is PR 11006 and thus covered elsewhere. It has nothing to do with arrays, just with a bad interaction between C++ and java builtin types. In effect, this report is now only about the Java array stuff. W.
Closing as won't fix as the Java front-end has been removed from the trunk.