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

Fix USE rename when use-name and local-name are the same. Previously, the associated symbol was being removed from scope. Operator rename implementation needed no change, because, as it doesn't call AddUseRename(), symbol erasure is skipped. Fixes #60223 Reviewed By: klausler Differential Revision: https://reviews.llvm.org/D143933
25 lines
422 B
Fortran
25 lines
422 B
Fortran
! RUN: %python %S/test_errors.py %s %flang_fc1
|
|
! Test rename to the same name.
|
|
module m1
|
|
integer, allocatable :: a(:)
|
|
|
|
interface operator(.add.)
|
|
module procedure add
|
|
end interface
|
|
|
|
contains
|
|
integer function add(a, b)
|
|
integer, intent(in) :: a, b
|
|
|
|
add = a + b
|
|
end function
|
|
end
|
|
|
|
program p1
|
|
use m1, a => a, operator(.add.) => operator(.add.)
|
|
|
|
allocate(a(10))
|
|
deallocate(a)
|
|
print *, 2 .add. 2
|
|
end
|