3 ! Test the fix for PR84546 in which the failing cases would
4 ! have x%vec = ['foo','b '].
6 ! Contributed by Neil Carlson <neil.n.carlson@gmail.com>
11 class(*), allocatable
:: vec(:)
20 function any_vector1(vec
) result(this
)
21 class(*), intent(in
) :: vec(:)
22 type(any_vector
) :: this
23 allocate(this
%vec
, source
=vec
)
33 class(*), allocatable
:: x
34 character(*), parameter :: vec(2) = ['foo','bar']
35 integer :: vec1(3) = [7,8,9]
44 subroutine foo1
! This always worked
45 allocate (any_vector
:: x
)
54 subroutine foo2
! Failure found during diagnosis
60 subroutine foo3
! Original failure
61 allocate (x
, source
= any_vector (vec
))
66 subroutine foo4
! This always worked
67 allocate (x
, source
= any_vector (vec1
))
72 subroutine bar (stop_flag
)
76 select
type (xvec
=> x
%vec
)
77 type is (character(*))
78 if (any(xvec
/= vec
)) stop stop_flag
80 if (any(xvec
/= (vec1
))) stop stop_flag