re PR java/14231 (Incorrect interface method called when compiling against .class...
authorAndrew Haley <aph@redhat.com>
Thu, 26 Feb 2004 15:34:05 +0000 (15:34 +0000)
committerAndrew Haley <aph@gcc.gnu.org>
Thu, 26 Feb 2004 15:34:05 +0000 (15:34 +0000)
2004-02-26  Andrew Haley  <aph@redhat.com>

        PR java/14231:
        * parse.y (check_interface_throws_clauses): Check for
        !METHOD_INVISIBLE (iface_method).
        * class.c (layout_class_methods): Check for CLASS_INTERFACE as
        well as CLASS_ABSTRACT.

From-SVN: r78505

gcc/java/ChangeLog
gcc/java/class.c
gcc/java/parse.y

index a1a368508ce84bd44acfdb9cff0acce8b936c863..b300dd3acd9df73c575fba96c6c60dd121e7a1a1 100644 (file)
@@ -1,3 +1,11 @@
+2004-02-26  Andrew Haley  <aph@redhat.com>
+
+       PR java/14231:
+       * parse.y (check_interface_throws_clauses): Check for
+       !METHOD_INVISIBLE (iface_method).
+       * class.c (layout_class_methods): Check for CLASS_INTERFACE as
+       well as CLASS_ABSTRACT.
+       
 2004-02-25  Per Bothner  <per@bothner.com>
 
        * parse.y (build_assertion):  If we're in an inner class, create the
index f6471ef5c490240347c805b3caee5b97114fd0bf..be9958b31e4e172999250e383e6981a272756a80 100644 (file)
@@ -2053,7 +2053,7 @@ void
 layout_class_methods (tree this_class)
 {
   tree method_decl, dtable_count;
-  tree super_class;
+  tree super_class, type_name;
 
   if (TYPE_NVIRTUALS (this_class))
     return;
@@ -2070,7 +2070,8 @@ layout_class_methods (tree this_class)
   else
     dtable_count = integer_zero_node;
 
-  if (CLASS_ABSTRACT (TYPE_NAME (this_class)))
+  type_name = TYPE_NAME (this_class);
+  if (CLASS_ABSTRACT (type_name) || CLASS_INTERFACE (type_name))
     {
       /* An abstract class can have methods which are declared only in
         an implemented interface.  These are called "Miranda
index 8e419a55d776b192c69a90da5a854e64f7f1d3e1..446661b93fd37346f6e320f231e609bfbba93c38 100644 (file)
@@ -6525,7 +6525,8 @@ check_interface_throws_clauses (tree check_class_decl, tree class_decl)
                 Also, multiple inheritance with conflicting throws
                 clauses is fine in the absence of a concrete
                 implementation.  */
-             if (method != NULL_TREE && !METHOD_ABSTRACT (method))
+             if (method != NULL_TREE && !METHOD_ABSTRACT (method)
+                 && !METHOD_INVISIBLE (iface_method))
                {
                  tree method_wfl = DECL_FUNCTION_WFL (method);
                  check_throws_clauses (method, method_wfl, iface_method);