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

When there are multiple USE statement for a particular module using renaming, it is necessary to collect a set of all of the original renaming targets before processing any of USE statements that don't have ONLY: clauses. Currently, if there is a name in the module that can't be added to the current scope -- due to a conflict with an internal or module subprogram, or with a previously use-associated name -- the compiler will emit a bogus error message even if that conflicting name appear on a later USE statement of the same module as the target of a renaming. The new regression test case added with this patch provides a motivating example.
22 lines
410 B
Fortran
22 lines
410 B
Fortran
! RUN: %flang_fc1 -fsyntax-only -pedantic %s 2>&1 | FileCheck %s --allow-empty
|
|
! Regression test for bogus use-association name conflict
|
|
! error: Cannot use-associate 's2'; it is already declared in this scope
|
|
! CHECK-NOT: error:
|
|
module m1
|
|
contains
|
|
subroutine s1
|
|
end
|
|
subroutine s2
|
|
end
|
|
end
|
|
|
|
module m2
|
|
use m1, s1a => s1
|
|
use m1, s2a => s2
|
|
contains
|
|
subroutine s1
|
|
end
|
|
subroutine s2
|
|
end
|
|
end
|