This is the mail archive of the gcc-bugs@gcc.gnu.org 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]

[Bug fortran/61527] [4.9/5 Regression] class/extends, multiple generic assignment, accept invalid


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61527

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |janus at gcc dot gnu.org

--- Comment #6 from janus at gcc dot gnu.org ---
(In reply to Tobias Burnus from comment #3)
> It seems to be due to the following code in interface.c, which was added for
> PR57530 in r201329:

Reverting this part of the patch ...


Index: gcc/fortran/interface.c
===================================================================
--- gcc/fortran/interface.c    (Revision 219753)
+++ gcc/fortran/interface.c    (Arbeitskopie)
@@ -515,12 +515,6 @@
   if (s2->attr.ext_attr & (1 << EXT_ATTR_NO_ARG_CHECK))
     return 1;

-  /* TYPE and CLASS of the same declared type are type compatible,
-     but have different characteristics.  */
-  if ((s1->ts.type == BT_CLASS && s2->ts.type == BT_DERIVED)
-      || (s1->ts.type == BT_DERIVED && s2->ts.type == BT_CLASS))
-    return 0;
-
   return gfc_compare_types (&s1->ts, &s2->ts) || s2->ts.type == BT_ASSUMED;
 }


... indeed brings back the expected error message for comment 0. However, it
causes a few testsuite regressions:

FAIL: gfortran.dg/dummy_procedure_4.f90   -O   (test for errors, line 28)
FAIL: gfortran.dg/proc_ptr_30.f90   -O   (test for errors, line 25)
FAIL: gfortran.dg/proc_ptr_comp_32.f90   -O   (test for errors, line 34)
FAIL: gfortran.dg/proc_ptr_comp_33.f90   -O   (test for errors, line 14)
FAIL: gfortran.dg/proc_ptr_comp_33.f90   -O   (test for errors, line 54)


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