Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.
29309 Discussions

PURE, POINTERS, INTENT, derived types...

John4
Valued Contributor I
1,241 Views

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

0 Kudos
1 Solution
Steven_L_Intel1
Employee
1,241 Views
This issue is fixed in Update 4, available now.

View solution in original post

0 Kudos
3 Replies
Steven_L_Intel1
Employee
1,241 Views
Hmm - this doesn't look right to me. I'll send it to the developers. Issue ID is DPD200140892
0 Kudos
Steven_L_Intel1
Employee
1,241 Views
This is expected to be fixed in Update 4, scheduled for mid-December.
0 Kudos
Steven_L_Intel1
Employee
1,242 Views
This issue is fixed in Update 4, available now.
0 Kudos
Reply