Version of flang-new : 19.0.0(4f19f15a601a5761b12c9c66d99d97dbc89ef90d)/AArch64
When a function defined in module and a statement function used in an internal subroutine have the same name, a compilation error occurs.
The following are the test program, Flang-new, Gfortran and ifort compilation/execution result.
sngg657d_2.f90:
module m1
contains
function ifun() result(r)
r=0
end function ifun
end module m1
program main
use m1
call test03
print *,'pass'
contains
subroutine test03()
ifun()=1
if (ifun()/=1) print *,101
end subroutine test03
end program main
$ flang-new sngg657d_2.f90; ./a.out
error: Semantic errors in sngg657d_2.f90
./sngg657d_2.f90:14:5: error: 'ifun' has not been declared as an array or pointer-valued function
ifun()=1
^^^^
$
$ gfortran sngg657d_2.f90; ./a.out
pass
$
$ ifort -diag-disable=10448 sngg657d_2.f90; ./a.out
pass
$