[Bug fortran/81447] [7/8] gfortran fails to recognize the exact dynamic type of a polymorphic entity that was allocated in a external procedure
pault at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jul 27 08:36:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81447
Paul Thomas <pault at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |pault at gcc dot gnu.org
--- Comment #2 from Paul Thomas <pault at gcc dot gnu.org> ---
Bother!
I had better take this one, although it will be some weeks before I can turn to
it because my workstation has died and is subject to a warranty claim.
I can see what the problem is from this workaround:
Module m
Type :: t
End Type
class (t), pointer :: ptr
End Module
The module class object forces a production of a vtable in the module
namespace. r241403 introduced the use of the address of the vtable as a unique
distinguishing feature of the dynamic type. In your testcase, Mat, the
subroutine 's' is forced to generate a separate vtable. Note that vtables are
not excluded by the use list.
The fix is obvious - create a vtable for all module derived type declarations
even when there is no OOP in the module.
Thanks for the report.
Paul
More information about the Gcc-bugs
mailing list