111
|
1 ! { dg-do compile }
|
|
2 !
|
|
3 ! PR fortran/51948
|
|
4 !
|
|
5 type :: t
|
|
6 end type t
|
|
7 contains
|
|
8 function func(x, y)
|
|
9 class(t) :: y
|
|
10 type(t), allocatable :: func
|
|
11 type(t), allocatable :: x
|
|
12
|
|
13 select type (y)
|
|
14 type is(t)
|
|
15 call move_alloc (x, func)
|
|
16 end select
|
|
17 end function
|
|
18
|
|
19 function func2(x, y)
|
|
20 class(t) :: y
|
|
21 class(t), allocatable :: func2
|
|
22 class(t), allocatable :: x
|
|
23
|
|
24 block
|
|
25 block
|
|
26 select type (y)
|
|
27 type is(t)
|
|
28 call move_alloc (x, func2)
|
|
29 end select
|
|
30 end block
|
|
31 end block
|
|
32 end function
|
|
33 end
|