3 ! Test the fix for PR78990 in which the scalarization of the assignment
4 ! in the main program failed for two reasons: (i) The conversion of 'v1'
5 ! into a class actual was being done after the call to 'return_t1', giving
6 ! rise to the ICE reported in comment #1; and (ii) The 'info' descriptor,
7 ! required for scalarization was not set, which gave rise to the ICE noted
10 ! Contributed by Chris Macmackin <cmacmackin@gmail.com>
19 generic
:: assignment(=) => assign
24 elemental
subroutine assign(this
,rhs
)
25 class(t1
), intent(inout
) :: this
26 class(t1
), intent(in
) :: rhs
30 function return_t1(arg
)
31 class(t1
), dimension(:), intent(in
) :: arg
32 class(t1
), dimension(:), allocatable
:: return_t1
33 allocate(return_t1(size(arg
)), source
=arg
)
34 end function return_t1
36 function return_t1_p(arg
)
37 class(t1
), dimension(:), intent(in
), target
:: arg
38 class(t1
), dimension(:), pointer :: return_t1_p
40 end function return_t1_p
47 type(t1
), dimension(3) :: v1
, v2
50 if (any (v2
%i
.ne
. v1
%i
)) call abort
54 if (any (v2
%i
.ne
. v1
%i
)) call abort