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/82064] [7/8 Regression] [OOP] multiple incompatible definitions of extended derived type via module use


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

--- Comment #7 from janus at gcc dot gnu.org ---
(In reply to Paul Thomas from comment #4)
> The permanent fix is to make sure that the vtables get produced
> unconditionally for module derived types.

This is accomplished by the following patch ...


Index: gcc/fortran/decl.c
===================================================================
--- gcc/fortran/decl.c  (revision 253282)
+++ gcc/fortran/decl.c  (working copy)
@@ -9881,6 +9881,9 @@ gfc_match_derived_decl (void)
   /* Take over the ABSTRACT attribute.  */
   sym->attr.abstract = attr.abstract;

+  if (gfc_current_state () == COMP_MODULE)
+    gfc_find_derived_vtab (sym);
+
   gfc_new_block = sym;

   return MATCH_YES;


... which indeed fixes the issue with 'test_sep'. (Note: I have not regtested
it yet, but I hope it will not break anything.)

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