Consider the following, which uses a character array expression using an ELEMENTAL function:
program ftn95bug implicit none
character(8) :: indata(4) = (/ & '12344321', '98766789', 'abcdefgh', 'ABCDEFGH' & /)
call process (myfunc (indata))
contains
pure function myfunc (s) character(*), intent(in) :: s(:) character(len (s)) :: myfunc(size (s))
myfunc = s
end function
subroutine process (strings) character(*), intent(in) :: strings(:)
print *, strings
end subroutine
end program
When compiling this with FTN95 I get the following error:
$ ftn95 ftn95bug.f90 [FTN95/Win32 Ver. 5.10.0 Copyright (c) Silverfrost Ltd 1993-2007] NO ERRORS [<MYFUNC> FTN95/Win32 v5.10.0] NO ERRORS [<PROCESS> FTN95/Win32 v5.10.0] 0008) call process (myfunc (indata)) *** In the INTERFACE to PROCESS, the first argument (STRINGS) is rank 1, but it is a scalar in this call 1 ERROR [<FTN95BUG> FTN95/Win32 v5.10.0] *** Compilation failed
$
Since an array is given as the actual argument to the function, the result is also an array. So the above should be legal. And indeed, it compiles just fine on a number of other compilers. (Though it causes gfortran to ICE...)
Interestingly, an INTEGER version of the above test case compiles and runs fine.