[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
Loading
Please sign in to comment