(j3.2006) allocatable components and TRANSFER
Robert Corbett
Robert.Corbett
Fri Oct 30 04:42:29 EDT 2009
A member of Sun's Fortran team raised a question about
allocatable components and the intrinsic function
TRANSFER. He (in effect) asked if the program
PROGRAM MAIN
INTEGER DATA(100)
TYPE T
REAL, ALLOCATABLE :: A(:)
END TYPE
TYPE(T) X, Y
ALLOCATE(X%A(100))
DATA = TRANSFER(X, DATA)
Y = TRANSFER(DATA, Y)
END
is standard conforming and is required to allocate a
second array when it assigns to Y. I told him I do
not think the program is standard conforming, even if
the array DATA is large enough to hold a value of
type T.
Bob Corbett
More information about the J3
mailing list