------- Comment #8 from janus at gcc dot gnu dot org  2010-03-07 14:07 -------
(In reply to comment #7)
> This leaves us with the following regressions:
> 
> FAIL: gfortran.dg/dynamic_dispatch_1.f03  -O0  (test for excess errors)
> FAIL: gfortran.dg/dynamic_dispatch_3.f03  -O0  (test for excess errors)
> FAIL: gfortran.dg/dynamic_dispatch_4.f03  -O0  (test for excess errors)
> FAIL: gfortran.dg/dynamic_dispatch_6.f03  -O0  (test for excess errors)
> 
> due to the error
> 
> Error: Type mismatch in argument '...' at (1); passed CLASS(...) to CLASS(...)


These are resolved when adding to the patches in comment #3 and #7 the
following one:

Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c       (revision 157262)
+++ gcc/fortran/resolve.c       (working copy)
@@ -5178,18 +5178,17 @@ check_class_members (gfc_symbol *derived)
       return;
     }

-  if (tbp->n.tb->is_generic)
+  /* If we have to match a passed class member, force the actual
+      expression to have the correct type.  */
+  if (!tbp->n.tb->nopass)
     {
-      /* If we have to match a passed class member, force the actual
-        expression to have the correct type.  */
-      if (!tbp->n.tb->nopass)
-       {
-         if (e->value.compcall.base_object == NULL)
-           e->value.compcall.base_object =
-                       extract_compcall_passed_object (e);
+      if (e->value.compcall.base_object == NULL)
+       e->value.compcall.base_object = extract_compcall_passed_object (e);

-          e->value.compcall.base_object->ts.type = BT_DERIVED;
-          e->value.compcall.base_object->ts.u.derived = derived;
+      if (!derived->attr.abstract)
+       {
+         e->value.compcall.base_object->ts.type = BT_DERIVED;
+         e->value.compcall.base_object->ts.u.derived = derived;
        }
     }

I hope that's it now. I'll do another regtest to make sure ...


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43256

Reply via email to