mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 15:56:40 +00:00

For the program provided as the test case flang fired the following error: error: Semantic errors in main.f90 error: 'foo' is not a procedure This change fixes the error by postponing handling of `UseErrorDetails` from `CharacterizeProcedure` to a later stage. Reviewed By: kiranchandramohan Differential Revision: https://reviews.llvm.org/D125791
33 lines
597 B
Fortran
33 lines
597 B
Fortran
! RUN: %python %S/test_errors.py %s %flang_fc1
|
|
|
|
! If there are 2 or more use-associated symbols
|
|
! from different modules with the same name,
|
|
! the error should be generated only if
|
|
! the name is actually used.
|
|
module a
|
|
contains
|
|
function foo()
|
|
foo = 42
|
|
end function foo
|
|
end module a
|
|
|
|
module b
|
|
contains
|
|
function foo()
|
|
foo = 42
|
|
end function foo
|
|
end module b
|
|
|
|
subroutine without_error
|
|
use a
|
|
use b
|
|
end subroutine without_error
|
|
|
|
subroutine with_error
|
|
use a
|
|
use b
|
|
integer :: res
|
|
! ERROR: Reference to 'foo' is ambiguous
|
|
res = foo()
|
|
end subroutine with_error
|