https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78737
Paul Thomas <pault at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pault at gcc dot gnu.org --- Comment #8 from Paul Thomas <pault at gcc dot gnu.org> --- (In reply to janus from comment #5) > (In reply to janus from comment #4) > > Looking at the dump, one probably needs a polymorphic reference to > > 'a->_vptr->write_formatted' instead of using the interface? > > Btw, such wrong-code behavior is also seen in the non-abstract version: > > > module object_interface > type :: object > contains > procedure :: write_formatted > generic :: write(formatted) => write_formatted > end type > contains > subroutine write_formatted(this,unit,iotype,vlist,iostat,iomsg) > class(object), intent(in) :: this > integer, intent(in) :: unit > character (len=*), intent(in) :: iotype > integer, intent(in) :: vlist(:) > integer, intent(out) :: iostat > character (len=*), intent(inout) :: iomsg > end subroutine > > subroutine assert(a) > class(object):: a > write(*,*) a > end subroutine > end module > > end > > > If the write procedure is overwritten in an extended type, then the write > statement still calls the one from the base class, which is wrong. Janus, We interpreted the standard to imply that a SELECT TYPE is required in write_formatted to obtain the correct dtio io procedure. I did think about adding pointers to the procedures in the vtable but decided that the standard did not require it. Cheers Paul