This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/78848] [OOP] ICE on writing CLASS variable with non-typebound DTIO procedure
- 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, 18 Dec 2016 09:35:32 +0000
- Subject: [Bug fortran/78848] [OOP] ICE on writing CLASS variable with non-typebound DTIO procedure
- Auto-submitted: auto-generated
- References: <bug-78848-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78848
--- Comment #4 from janus at gcc dot gnu.org ---
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
contains
! procedure :: wf
! generic :: write(formatted) => wf
end type
interface write(formatted)
procedure wf
end interface
contains
subroutine wf(this, unit, b, c, iostat, iomsg)
class(t), intent(in) :: this
integer, intent(in) :: unit
character, intent(in) :: b
integer, intent(in) :: c(:)
integer, intent(out) :: iostat
character, intent(inout) :: iomsg
WRITE (unit, "(i3)", IOSTAT=iostat, IOMSG=iomsg) this%i
end subroutine
end
program p
use m
class(t), allocatable :: z
allocate(z)
print *, z
end