[all-commits] [llvm/llvm-project] f24c64: [flang] Fix bogus message on interface procedure a...

Pete Steinfeld via All-commits all-commits at lists.llvm.org
Thu Dec 3 12:14:04 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f24c642178a5a31aa1c44585537c08fdfc3fdfd5
      https://github.com/llvm/llvm-project/commit/f24c642178a5a31aa1c44585537c08fdfc3fdfd5
  Author: Peter Steinfeld <psteinfeld at nvidia.com>
  Date:   2020-12-03 (Thu, 03 Dec 2020)

  Changed paths:
    M flang/lib/Semantics/resolve-names.cpp
    M flang/test/Semantics/equivalence01.f90

  Log Message:
  -----------
  [flang] Fix bogus message on interface procedure argument names

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 not checking equivalence sets when we're in an interface
block.  I also added a test that will produce an error message without
this change.

Differential Revision: https://reviews.llvm.org/D92501




More information about the All-commits mailing list