flang-new version is: flang-new version 20.0.0git (https://github.com/llvm/llvm-project.git 46fe36a4295f05d5d3731762e31fc4e6e99863e9)
- Reduced test case is:
! foo.f90
module foo
real :: qux(10, 10, 10)
interface
module subroutine bar(i)
end
module function baz()
end
end interface
end
submodule (foo) foo_impl
contains
module procedure bar
qux(i, i, i) = baz()
end
module procedure baz
end
end
flang-new invocation is: flang-new foo.f90
- Expected behavior is: The code compiles sucessfully without errors, as
baz should be accessible through host association in bar.
- Actual behavior: Compilation fails with the following error:
error: Semantic errors in /foo.f90
foo.f90:17:22: error: The module function 'baz' may not be referenced recursively in a specification expression
qux(i, i, i) = baz()
^^^^^
- Additional information: Reordering the definitions of the procedures in the submodule seems to work around the issue for now.