18.10 Fortran associate bug


I found an unexpected behavior when using associate for arrays of derived type:

program associate_broken
 implicit none
 integer, dimension(3) :: i
 type :: tParameters
   real, allocatable, dimension(:) :: &
 end type tParameters

 type(tParameters),  allocatable, dimension(:) :: param

 i = 1
 associate(prm => param(i(2)))
   print*, allocated(prm%xi_slip0)
   print*, allocated(param(i(2))%xi_slip0)
 end associate

end program

for some reasons, the second print gives F, even though it should be T

Thanks MarDie!

I’ve added a problem report (TPR #27049) and sent it to engineering for further investigation.


many thanks!