[PATCH] D92501: [flang] Fix bogus message on interface procedure argument names

Pete Steinfeld via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 2 12:41:26 PST 2020


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

We were keeping the state of parsed equivalence sets in the class
DeclarationVisitor.  A problem happened when  analyzing the the specification
part of a declaration that contained an EQUIVALENCE statement followed by an
interface block.  The same DeclarationVisitor object that was created for the
outer declaration was being used to analyze the specification part
of a procedure body in the interface block.  When analyzing the specification
part of the procedure in the interface block, the names in the outer
declaration's EQUIVALENCE statement were erroneously compared with the names in
the arguments of the interface procedure.  This resulted in a bogus error
message.

I fixed this by moving the state of the equivalence sets to the class Scope.  I
added a test that will produce an error message without this change and
includes a test for erroneous EQUIVALENCE statements that appear in an
interface block.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92501

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92501.309032.patch
Type: text/x-patch
Size: 4143 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201202/42b9b7df/attachment-0001.bin>


More information about the llvm-commits mailing list