[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 13:21:34 PST 2020


PeteSteinfeld added a comment.

In D92501#2429227 <https://reviews.llvm.org/D92501#2429227>, @klausler wrote:

> I don't think that moving a temporary data structure from declaration processing into a more permanent object like Scope to accomplish scoping is the right way to fix this problem, unfortunately.
>
> The specification-part of an interface block exists only to define the dummy arguments and (if there is one) the function result, so declarations of other local variables are moot in an interface outside of specification inquiries like SIZE().  Since local variables are the only objects that could meaningfully appear in an EQUIVALENCE statement in the specification part of an interface -- dummies can't be EQUIVALENCEd and there's nothing to be learned from an EQUIVALENCE of a function result -- there's no good reason to check such EQUIVALENCE statements for anything.  I think that we should warn about their uselessness and otherwise ignore them.

Thanks, Peter.  I thought about doing it that way, but I rejected it since that makes it impossible to detect errors in an EQUIVALENCE statement that appears in an interface block, moot or not.  But I'm happy to follow your reasoning.  My plan is now to avoid semantic checking on EQUIVALENCE statements when analyzing the specification part of a procedure in an interface block.  This means that errors in such EQUIVALENCE statements will go undetected.  But, as you say, such errors are irrelevant to the program.

Stop me if you think this is the wrong strategy for fixing this problem.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92501/new/

https://reviews.llvm.org/D92501



More information about the llvm-commits mailing list