[flang] Allow ENTRY function result symbol usage before the ENTRY
authorPeter Klausler <pklausler@nvidia.com>
Wed, 4 May 2022 19:50:03 +0000 (12:50 -0700)
committerPeter Klausler <pklausler@nvidia.com>
Tue, 10 May 2022 02:12:23 +0000 (19:12 -0700)
commit8c407f4a1121ac3eaf46ca6e92f0976c196ce35b
tree7a07277daa91ec03069b68c9422243347171bf22
parentdebd9bf3f0198984cb4ae66c16758e0c8eeb2e9e
[flang] Allow ENTRY function result symbol usage before the ENTRY

In a function, ENTRY E without an explicit RESULT() creates a
function result entity also named E that is storage associated with
the enclosing function's result.  f18 was emitting an incorrect error
message if that function result E was referenced without any
declaration prior to its ENTRY statement when it should have been
implicitly declared instead.

Differential Revision: https://reviews.llvm.org/D125144
flang/lib/Semantics/resolve-names.cpp
flang/test/Semantics/entry01.f90