This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/78737] [OOP] linking error with deferred, undefined user-defined derived-type I/O
- 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: Sun, 11 Dec 2016 22:22:16 +0000
- Subject: [Bug fortran/78737] [OOP] linking error with deferred, undefined user-defined derived-type I/O
- Auto-submitted: auto-generated
- References: <bug-78737-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78737
--- Comment #11 from janus at gcc dot gnu.org ---
(In reply to Paul Thomas from comment #8)
> (In reply to janus from comment #5)
> >
> > module object_interface
> > type :: object
> > contains
> > procedure :: write_formatted
> > generic :: write(formatted) => write_formatted
> > end type
>
> Janus,
>
> We interpreted the standard to imply that a SELECT TYPE is required in
> write_formatted to obtain the correct dtio io procedure.
Huh, that sounds quite surprising to me. Could you explain how you came to that
conclusion?
In my above example, 'write_formatted' is certainly a normal type-bound
procedure that can be called in a polymorphic context. Shouldn't the DTIO
generic binding be treated like any other typebound generic binding, meaning
that it should be resolved to a polymorphic typebound call in a write
statement?
> I did think about adding pointers to the procedures in the vtable but
> decided that the standard did not require it.
I don't think that's necessary anyway. We don't need any vtab entries for other
typebound generics either, since they are resolved to a specific typebound
procedure at compile-time. Therefore only vtab entries for specific TBPs are
required (which we have already of course) and no additional hooks should be
necessary for 'polymorphic DTIO', right?