mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 16:26:42 +00:00

When the implementation of one SMP apparently references another in what might be a specification expression, semantics may need to resolve it as a forward reference, and to allow for the replacement of a SubprogramNameDetails place-holding symbol with the final SubprogramDetails symbol. Otherwise, as in the bug report below, confusing error messages may result. (The reference in question isn't really in the specification part of a subprogram, but due to the syntactic ambiguity between the array element assignment statement and a statement function definition, it appears to be so at the time that the reference is processed.) I needed to make DumpSymbols() available via SemanticsContext to analyze this bug, and left that new API in place to make things easier next time. Fixes https://github.com/llvm/llvm-project/issues/106705.
21 lines
314 B
Fortran
21 lines
314 B
Fortran
!RUN: %flang_fc1 -fsyntax-only %s
|
|
module m
|
|
real :: qux(10)
|
|
interface
|
|
module subroutine bar(i)
|
|
end
|
|
module function baz()
|
|
end
|
|
end interface
|
|
end
|
|
|
|
submodule(m) sm
|
|
contains
|
|
module procedure bar
|
|
qux(i) = baz() ! ensure no bogus error here
|
|
end
|
|
module procedure baz
|
|
baz = 1.
|
|
end
|
|
end
|