http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51948
Bug #: 51948
Summary: [OOP] Rejects valid: Polymorphic arguments in
MOVE_ALLOC
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: fortran
AssignedTo: [email protected]
ReportedBy: [email protected]
The following fails at move_alloc with bogus errors. The second example is
based on the example from
chapter09/burgers_factory_f2003/periodic_6th_order.F90 in the book
http://www.cambridge.org/rouson
type t
end type t
contains
function func(x)
class(t), allocatable :: x(:), func(:)
call move_alloc (x, func)
! FAILS: Error: the 'from' and 'to' arguments of 'move_alloc' intrinsic at (1)
must have the same rank 0/1
end function
function func2(x)
type(t), allocatable :: x
class(t), allocatable :: func2
call move_alloc (x, func)
! FAILS: Error: 'to' argument of 'move_alloc' intrinsic at (1) must be a
variable
end function
end