This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: RFA: Fix java/20697
- From: Bryce McKinlay <mckinlay at redhat dot com>
- To: java-patches at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Wed, 15 Jun 2005 19:17:31 -0400
- Subject: 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?
Bryce
2005-06-15 Bryce McKinlay <mckinlay@redhat.com>
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);
}
}