[Patch, fortran] PR24862 IO for arrays of derived type.

Janne Blomqvist jblomqvi@cc.hut.fi
Thu Nov 17 19:42:00 GMT 2005


On Thu, Nov 17, 2005 at 11:32:56AM +0200, Janne Blomqvist wrote:
> Hello,
> 
> my transfer_array patch that was committed about two months ago didn't
> handle IO for arrays of derived type correctly. This patch fixes it.

The test case was a bit excessive; it wasn't needed to have the type
definition in a separate module. Reduced testcase attached.


-- 
Janne Blomqvist
-------------- next part --------------
! { dg-do run }
! PR 24862: IO for arrays of derived type handled incorrectly.
program arrayio_derived_1
  implicit none
  type tp
     integer :: i
  end type tp
  type(tp) :: Y(5)

  call inittp(Y)
  write(*,*) Y%i
  call test(Y)

  contains

  subroutine inittp(X)
    type(tp), intent(inout) :: X(:)
    X%i = 256
  end subroutine inittp

  subroutine test(x)
    type(tp), intent(in) :: x(:)
    
    write(*,*) x%i
    write(*,*) x
  end subroutine test

end program arrayio_derived_1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 185 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20051117/a0e37ed7/attachment.sig>


More information about the Fortran mailing list