This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/82064] [7/8 Regression] [OOP] multiple incompatible definitions of extended derived type via module use
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 03 Oct 2017 15:29:54 +0000
- Subject: [Bug fortran/82064] [7/8 Regression] [OOP] multiple incompatible definitions of extended derived type via module use
- Auto-submitted: auto-generated
- References: <bug-82064-4@http.gcc.gnu.org/bugzilla/>
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.)