Hi,
When I remove the PURE prefix, the code below compiles just fine. With the PURE prefix, however, I get the error message: "The dummy argument of a derived type containing a pointer component has the INTENT(IN) attribute therefore it shall not appear as the expr of an assignment-stmt in a PURE procedure". Is the compiler right at complaining? The error message seems kind of misleading, by the way ---since the argument's attribute is INTENT(INOUT).
!---------------------------------------------------------------------
module mod1
 implicit none
 type, public :: struct
 integer :: item = 0
 type(struct), pointer :: next(:) => NULL()
 end type
contains
 pure subroutine dummy(array)
 type(struct), allocatable, intent(INOUT) :: array(:)
 array(1:) = array(1:)
 end subroutine
end module mod1
連結已複製
 
					
				
				
			
		
