This is the mail archive of the mailing list for the GCC 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]

Patch: RFA: Fix java/20697

This patch fixes bug java/20697 (aka java/22060). find_most_specific_method_list() contained a special case that assigns a higher "specific count" to inner classes. This doesn't appear to serve any useful purpose and probably dates from when find_applicable_accessible_methods_list() used to incorrectly dig through enclosing contexts in search of candidate methods. Because of this, a regular class and its inner-class super could end up with the same count and trigger a bogus ambiguity error.

No testsuite regressions (including JACKS). OK?


2005-06-15  Bryce McKinlay  <>

	PR java/20697
	* parse.y (find_most_specific_methods_list): Remove special case for
	inner classes.

Index: parse.y
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.539
diff -u -r1.539 parse.y
--- parse.y	13 Jun 2005 19:20:22 -0000	1.539
+++ parse.y	15 Jun 2005 23:06:16 -0000
@@ -11416,13 +11416,9 @@
 	  if (argument_types_convertible (method_v, current_v))
 	      if (valid_method_invocation_conversion_p
-		  (DECL_CONTEXT (method_v), DECL_CONTEXT (current_v))
-		  || (INNER_CLASS_TYPE_P (DECL_CONTEXT (current_v))
-		      && enclosing_context_p (DECL_CONTEXT (method_v),
-					      DECL_CONTEXT (current_v))))
+		  (DECL_CONTEXT (method_v), DECL_CONTEXT (current_v)))
-		  int v = (DECL_SPECIFIC_COUNT (current_v) +=
-		    (INNER_CLASS_TYPE_P (DECL_CONTEXT (current_v)) ? 2 : 1));
+		  int v = (DECL_SPECIFIC_COUNT (current_v) += 1);
 		  max = (v > max ? v : max);

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