[flang] Inner INTRINSIC must not shadow host generic
authorPeter Klausler <pklausler@nvidia.com>
Thu, 14 Apr 2022 21:55:47 +0000 (14:55 -0700)
committerPeter Klausler <pklausler@nvidia.com>
Thu, 14 Apr 2022 22:42:44 +0000 (15:42 -0700)
commit8065e482189104af30acf46c16ac6c5f6e270d0a
tree65f33a2bf3ab23478dee6977817711080869e16a
parent31ea4798ad0990838ccd27f80ca112f177ce91d9
[flang] Inner INTRINSIC must not shadow host generic

A generic interface (however spelled) can have the same name as
an intrinsic procedure in the same scope.  When an explicit INTRINSIC
attribute statement appears in a nested scope, semantics was
unconditionally declaring a new symbol that hid the generic entirely.
Catch this case and create instead a host association symbol for
the generic that can then be decorated with the INTRINSIC attribute.

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