This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gcjx] Patch: FYI: minor parser bug


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,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]