[Bug fortran/115781] Error with passing array of derived type
tkoenig at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Feb 18 19:19:47 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115781
--- Comment #6 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
This bug depends on the dummy argument being a class.
Here's a somewhat shortened version:
program simple
implicit none
type :: matrix
integer :: nRows
end type matrix
type(matrix),dimension(:), allocatable :: mats
allocate(mats(2:2))
mats(2)%nRows = 2
call use_mats(mats)
contains
subroutine use_mats(x)
class(matrix),dimension(:),intent(IN) :: x
if (x(1)%nrows /= 2) error stop
end subroutine use_mats
end program simple
More information about the Gcc-bugs
mailing list