The following program doesn't compile: public interface OutSideInterface { public interface InsideInterface { void m(int p, int p2); }; } Note the empty statement (semicolon) on line 6. This is legal (jikes accepts it) but deprecated. Compiling with -C gives: OutSideInterface.java:6: error: '{' expected. }; ^ OutSideInterface.java:7: error: Class or interface declaration expected. } ^ 2 errors Reported by Jerry Haltom. With -Wextraneous-semicolon the compiler does see that this is just an declaration: OutSideInterface.java:6: warning: An empty declaration is a deprecated feature that should not be used.
The relevant JLS production is ClassMemberDeclaration: http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#18988
Confirmed.
I'm testing a patch.
Subject: Bug 19674 CVSROOT: /cvs/gcc Module name: gcc Changes by: bryce@gcc.gnu.org 2005-07-05 21:09:58 Modified files: gcc/java : ChangeLog parse.y libjava : ChangeLog Added files: libjava/testsuite/libjava.compile: PR19674.java Log message: 2005-07-05 Bryce McKinlay <mckinlay@redhat.com> PR java/19674 * parse.y (interface_member_declaration): Allow empty statements in interface declarations. 2005-07-05 Bryce McKinlay <mckinlay@redhat.com> * testsuite/libjava.compile/PR19674.java: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&r1=1.1640&r2=1.1641 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/parse.y.diff?cvsroot=gcc&r1=1.545&r2=1.546 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&r1=1.3690&r2=1.3691 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/testsuite/libjava.compile/PR19674.java.diff?cvsroot=gcc&r1=NONE&r2=1.1
Fixed in HEAD
Subject: Bug 19674 CVSROOT: /cvs/gcc Module name: gcc Changes by: tromey@gcc.gnu.org 2005-07-12 22:35:04 Modified files: gcc/java : ChangeLog jvspec.c parse-scan.y Log message: PR java/19674: * parse-scan.y (interface_member_declaration): Added empty_statement. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&r1=1.1644&r2=1.1645 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/jvspec.c.diff?cvsroot=gcc&r1=1.70&r2=1.71 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/parse-scan.y.diff?cvsroot=gcc&r1=1.41&r2=1.42