[PATCH] D93345: [flang] Handle undeclared names in EQUIVALENCE statements

Pete Steinfeld via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 15 14:53:21 PST 2020


PeteSteinfeld created this revision.
PeteSteinfeld added reviewers: klausler, tskeith, jeanPerier.
PeteSteinfeld requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Names in EQUIVALENCE statements are only allowed to indicate local
objects as per 19.5.1.4, paragraph 2, item (10).  Thus, a name appearing
in an EQUIVALENCE statement with no corresponding declaration in the
same scope is an implicit declaration of the name.  If that scope
contains an IMPLICIT NONE, it's an error.

I implemented this by adding a state variable to the SemanticsContext to
indicate if we're resolving the names in an EQUIVALENCE statement and
then checked this state when resolving names.  I also added a test to
the existing tests for EQUIVALENCE statements.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D93345

Files:
  flang/include/flang/Semantics/scope.h
  flang/include/flang/Semantics/semantics.h
  flang/lib/Semantics/resolve-names.cpp
  flang/lib/Semantics/scope.cpp
  flang/test/Semantics/equivalence01.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93345.312045.patch
Type: text/x-patch
Size: 5059 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201215/e2e39bf6/attachment.bin>


More information about the llvm-commits mailing list