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

PURE, POINTERS, INTENT, derived types...

John4
傑出貢獻者 I
1,277 檢視

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 積分
1 解決方案
Steven_L_Intel1
1,277 檢視
This issue is fixed in Update 4, available now.

在原始文章中檢視解決方案

3 回應
Steven_L_Intel1
1,277 檢視
Hmm - this doesn't look right to me. I'll send it to the developers. Issue ID is DPD200140892
Steven_L_Intel1
1,277 檢視
This is expected to be fixed in Update 4, scheduled for mid-December.
Steven_L_Intel1
1,278 檢視
This issue is fixed in Update 4, available now.
回覆