[Bug fortran/78848] [7 Regression] [OOP] ICE on writing CLASS variable with non-typebound DTIO procedure

jvdelisle at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Dec 18 16:08:00 GMT 2016


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

--- Comment #10 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
(In reply to janus from comment #4)
> Sorry, actually the example in comment 3 only ICEs if the type-binding of
> the DTIO is commented out:
> 
> module m
>   type :: t
>     integer :: i  <------------if this is not here
>   contains
> !     procedure :: wf
> !     generic :: write(formatted) => wf
>   end type
>   interface write(formatted)
>     procedure wf
>   end interface

If you were asking if the non-typebound form using interface instead is valid
form, yes it is. I was looking down at the main body of your program and
wandering what should the print statement do. I have not looked yet, but I
assume it should compile a call to st_write followed by a call to
st_write_done, in the empty type case. Possibly with a call to transfer_derived
in between


More information about the Gcc-bugs mailing list