program test_lex
  type :: dtype
    integer :: n
    character*12 :: word
  end type dtype

  type(dtype), dimension(2) :: list
  list(1) = dtype (1 , "one")
  list(2) = dtype (2 , "two")

  call foo (list%word)

contains

  subroutine foo (slist)
    character*12, dimension(*) :: slist
    print *, ("\n",slist(i), i=1,2)
  end subroutine foo

end program test_lex

produces the output

[EMAIL PROTECTED] meissner]# ./a.out

one
    two

Examination of the code shows that the size of the derived type is not being
used to determine the stride of the array in the function.  This is one and the
same as the problem with pointer arrays pointing to same kind components of a
derived type array, which Tobi is fond of.


-- 
           Summary: Components of a derived type array not passed as an
                    array
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pault at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24276

Reply via email to