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

            Bug ID: 80484
           Summary: Three syntax errors involving derived-type I/O
           Product: gcc
           Version: 7.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: walt.brainerd at gmail dot com
  Target Milestone: ---

Windows 10, gcc 7.0.1 20170416

If the commented versions of the USE or WRITE statements
are used, the program works fine.

The function B converts wage to a structure with one component.

I can provide all the supporting code if needed,
but that doesn't seem relevant.

program test_b_format

   use b_format_mod, only: B, write (formatted)
!   use b_format_mod
   implicit none

   real :: wage = 15.10
   integer :: ios
   character(len=99) :: iom = "OK"

!   write (unit=*, fmt="(DT'$$$Z.##')", iostat=ios, iomsg=iom) B(wage)
   write (unit=*, fmt="(2DT'$$$Z.##')", iostat=ios, iomsg=iom) B(wage)
   write (unit=*, fmt="(DT'$$$Z.##'/)", iostat=ios, iomsg=iom) B(wage)
   print *, trim(iom)

end program test_b_format

test_b_format.f90:3:47:

    use b_format_mod, only: B, write (formatted)
                                               1
Error: Module nature in USE statement at (1) shall be either INTRINSIC or
NON_INTRINSIC
test_b_format.f90:12:36:

    write (unit=*, fmt="(2DT'$$$Z.##')", iostat=ios, iomsg=iom) B(wage)
                                    1
Error: Unexpected element ''' in format string at (1)
test_b_format.f90:13:35:

    write (unit=*, fmt="(DT'$$$Z.##'/)", iostat=ios, iomsg=iom) B(wage)
                                   1
Error: Unexpected element '/' in format string at (1)

Reply via email to