This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gcjx] Patch: FYI: minor parser bug
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 25 Jan 2005 19:37:47 -0700
- Subject: [gcjx] Patch: FYI: minor parser bug
- Reply-to: tromey at redhat dot com
I'm checking this in on the gcjx branch.
In a declaration like this:
int[] method() [] { ... }
we failed to update the method's return type after parsing the final
'[]'. This is deprecated syntax, but I still do occasionally run
across it in real code.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* source/parse.cc (any_method_declarator): Update method return
type if brackets follow method name.
Index: source/parse.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcjx/source/Attic/parse.cc,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 parse.cc
--- source/parse.cc 13 Jan 2005 03:18:37 -0000 1.1.2.1
+++ source/parse.cc 26 Jan 2005 02:37:40 -0000
@@ -2516,6 +2516,7 @@
member_type = brackets_opt (member_type);
if (member_type != save)
{
+ result->set_return_type (member_type);
if (global->get_compiler ()->warn_deprecated ())
std::cerr << format (new format_repr (format_type (global->get_compiler ()->warn_deprecated ()),
save_loc,