3 ! Ensure that move_alloc for CLASS resets the FROM variable's dynamic type
12 class(t
), allocatable
:: a
, b
, c
13 class(t
), allocatable
:: a2(:), b2(:), c2(:)
15 allocate (t2
:: a2(5))
16 call move_alloc (from
=a
, to=b
)
17 call move_alloc (from
=a2
, to=b2
)
18 !print *, same_type_as (a,c), same_type_as (a,b)
19 !print *, same_type_as (a2,c2), same_type_as (a2,b2)
20 if (.not
. same_type_as (a
,c
) .or
. same_type_as (a
,b
)) call abort ()
21 if (.not
. same_type_as (a2
,c2
) .or
. same_type_as (a2
,b2
)) call abort ()