2 ! PR38119 - The scalarizer got the loop size wrong
3 ! for the temporary coming from the call to 'same'.
5 ! Contributed by Mikael Morin <mikael.morin@tele2.fr>
6 ! based on a program by Vivek Rao.
10 character(len
= 2) :: c(1)
12 elemental
function trim_append (xx
,yy
) result(xy
)
13 character (len
= *), intent(in
) :: xx
,yy
14 character (len
= len (xx
) + len (yy
)) :: xy
15 xy
= trim (xx
) // trim (yy
)
16 end function trim_append
17 function same(xx
) result(yy
)
18 character (len
= *), intent(in
) :: xx(:)
19 character (len
= len (xx
)) :: yy(size (xx
))
23 c
= trim_append(["a"],same(["b"])) ! The problem occurred here
28 if (c(1) .ne
. "ab") STOP 1