(j3.2006) MOVE_ALLOC with coarrays
Tobias Burnus
burnus
Wed May 30 04:49:59 EDT 2012
Dear all,
I received the follow code, which is accepted by two compilers but
rejected (with an internal compiler error) by GCC/gfortran. I believe
that the code is invalid, but I cannot find anything but a rather
indirect hint for that.
Namely, the dummy arguments of MOVE_ALLOC are allocatable and "12.5.2.6
Allocatable dummy variables" states: "The corank of the actual argument
shall be the same as that of the dummy argument." If one now assumes (!)
that the dummy arguments have no corank, the code becomes invalid.
Do you concur that it is invalid? (If so, I think it should be made more
explicit in MOVE_ALLOC, e.g. in the revision next standard.)
real ,allocatable :: coarray(:,:)[:]
real ,allocatable :: local(:,:)
!...
call move_alloc (local, coarray)
end
Tobias
PS: Coindexed actual arguments are more explicitly excluded as FROM is
INTENT(INOUT) and TO is INTENT(OUT) - but 12.5.2.4 requires" "If the
actual argument is a coindexed object with an allocatable ultimate
component, the dummy argument shall have the INTENT (IN) or the VALUE
attribute."
More information about the J3
mailing list