[flang] Fix ENUMERATOR declarations in nested scopes
authorPeter Klausler <pklausler@nvidia.com>
Fri, 20 Jan 2023 01:01:06 +0000 (17:01 -0800)
committerPeter Klausler <pklausler@nvidia.com>
Sun, 29 Jan 2023 23:55:26 +0000 (15:55 -0800)
commitfac00d1b5d3923129afc3443bfb8fa40c9dbc2c8
treed5589eb65ee30eba1953c11904a8d2be4adaf06f
parent7a063c1a13b209425ef1611a5f08e2c500ac7f30
[flang] Fix ENUMERATOR declarations in nested scopes

ENUMERATOR declarations are checking for conflicts between new
enumerator names and names in both the local scope and scopes
that contain it.  ENUMERATOR declarations belong to the local
scope and so only a conflict with a name therein is an error.
(In short, use FindInScope rather than FindSymbol.)

Differential Revision: https://reviews.llvm.org/D142773
flang/lib/Semantics/resolve-names.cpp