[flang] Warn about local names that are the same as their enclosing program unit
authorPeter Klausler <pklausler@nvidia.com>
Mon, 14 Nov 2022 22:38:03 +0000 (14:38 -0800)
committerPeter Klausler <pklausler@nvidia.com>
Sun, 4 Dec 2022 01:47:35 +0000 (17:47 -0800)
commitdc0d56febba37ba672c1800be70a3ff5a42f4769
tree5c6dc065bebe6b580540940b6c9bd4ee8bbc0d26
parente86e2ab97300528e7a0fb4b63b87993fa054289e
[flang] Warn about local names that are the same as their enclosing program unit

Modules, submodules, main programs, and BLOCK DATA subprograms have names
that cannot be used within their scope, so we allow those names to be
used for other entities in the scope.  This might not be entirely
conformant with the language standard, so warn about it.

Differential Revision: https://reviews.llvm.org/D139146
flang/docs/Extensions.md
flang/lib/Semantics/check-declarations.cpp
flang/test/Semantics/OpenMP/omp-declare-target03.f90
flang/test/Semantics/OpenMP/omp-threadprivate03.f90
flang/test/Semantics/bind-c02.f90
flang/test/Semantics/resolve05.f90
flang/test/Semantics/resolve20.f90