3 ! Test diagnostic for MOVE_ALLOC:
4 ! FROM=type, TO=class is OK
5 ! FROM=class, TO=type is INVALID
10 procedure(intf
), deferred
, nopass
:: f
16 class(t2
), allocatable
:: intf
23 type, extends(t2
) :: t3
25 procedure
,nopass
:: f
=> my_f
29 class(t2
), allocatable
:: my_f
35 type(t3
), allocatable
:: x
36 class(t2
), allocatable
:: y
37 call move_alloc (x
, y
)
38 end subroutine my_test
44 type, extends(bar
) :: bar2
47 class(bar
), allocatable
:: sm
48 type(bar2
), allocatable
:: sm2
51 call move_alloc (sm
,sm2
) ! { dg-error "must be polymorphic if FROM is polymorphic" }
53 if (allocated(sm2
)) STOP 1
54 if (.not
. allocated(sm
)) STOP 2