Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29278 Discussions

MOVE_ALLOC returns wrong allocation status for polymorphic argument

NCarlson
New Contributor I
640 Views

Using 2025.0, the wrong result is returned by the following example program

type,abstract :: foo
end type
type, extends(foo) :: bar
end type
type(bar), allocatable :: x
class(foo), allocatable :: y
call move_alloc(x, y)
if (allocated(y)) stop 1 ! ERROR: Y SHOULD BE UNALLOCATED
end

Because x is unallocated, the allocation status of y should also be unallocated upon return from the move_alloc, but the program prints the error return status "1".

0 Kudos
3 Replies
TobiasK
Moderator
529 Views

@NCarlson

thanks for reporting this, I escalated it to our development team.


0 Kudos
TobiasK
Moderator
396 Views

@NCarlson


we implemented a fix for this issue which will be part of the 2025.2 release.


NCarlson
New Contributor I
364 Views

Great! Thanks for the update.

0 Kudos
Reply