[patch, libgfortran] PR80484 Three syntax errors involving derived-type I/O
Jerry DeLisle
jvdelisle@charter.net
Sun Apr 23 02:28:00 GMT 2017
Hi all,
The attached patch fixes these issues.
Regression tested on x86_64-pc-linux-gnu. New test attached.
OK for Trunk (8)? I think we should backport to 7 when it re-opens. The failing
repeat count on DT format is very not good.
Regards,
Jerry
2017-04-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/80484
* io.c (format_lex): Check for '/' and set token to FMT_SLASH.
(check_format): Move FMT_DT checking code to data_desc section.
* module.c (gfc_match_use): Include the case of INTERFACE_DTIO.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr80484.diff
Type: text/x-patch
Size: 2841 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20170423/a4ce29a2/attachment.bin>
-------------- next part --------------
! { dg-do compile }
! PR80484 Three syntax errors involving derived-type I/O
module dt_write_mod
type, public :: B_type
real :: amount
end type B_type
interface write (formatted)
procedure :: Write_b
end interface
contains
subroutine Write_b &
(amount, unit, b_edit_descriptor, v_list, iostat, iomsg)
class (B_type), intent(in) :: amount
integer, intent(in) :: unit
character (len=*), intent(in) :: b_edit_descriptor
integer, dimension(:), intent(in) :: v_list
integer, intent(out) :: iostat
character (len=*), intent(inout) :: iomsg
write (unit=unit, fmt="(f9.3)", iostat=iostat) amount%amount
end subroutine Write_b
end module dt_write_mod
program test
use dt_write_mod, only: B_type , write(formatted)
implicit none
real :: wage = 15.10
integer :: ios
character(len=99) :: iom = "OK"
write (unit=*, fmt="(DT'$$$Z.##')", iostat=ios, iomsg=iom) &
B_type(wage), B_type(wage)
print *, trim(iom)
write (unit=*, fmt="(2DT'$$$Z.##')", iostat=ios, iomsg=iom) &
B_type(wage), B_type(wage)
print *, trim(iom)
write (unit=*, fmt="(3DT'$$$Z.##')", iostat=ios, iomsg=iom) &
B_type(wage), B_type(wage)
print *, trim(iom)
write (unit=*, fmt="(DT'$$$Z.##'/)", iostat=ios, iomsg=iom) &
B_type(wage), B_type(wage)
print *, trim(iom)
end program test
More information about the Fortran
mailing list