This is an archive of the discontinued LLVM Phabricator instance.

[flang] Fix bug in IMPLICIT NONE(EXTERNAL)
ClosedPublic

Authored by tskeith on Dec 18 2020, 9:31 AM.

Details

Summary

We were only checking the restrictions of IMPLICIT NONE(EXTERNAL) when a
procedure name is first encountered. But it can also happen with an
existing symbol, e.g. if an external function's return type is declared
before is it called. This change adds a check in that branch too.

Diff Detail

Event Timeline

tskeith created this revision.Dec 18 2020, 9:31 AM
tskeith requested review of this revision.Dec 18 2020, 9:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 18 2020, 9:31 AM
klausler accepted this revision.Dec 18 2020, 11:23 AM
klausler added inline comments.
flang/lib/Semantics/resolve-names.cpp
5897

Could this check be in check-declarations.cpp?

This revision is now accepted and ready to land.Dec 18 2020, 11:23 AM
PeteSteinfeld accepted this revision.Dec 18 2020, 11:25 AM

All builds, tests, and looks good.

tskeith marked an inline comment as done.Dec 18 2020, 11:31 AM
tskeith added inline comments.
flang/lib/Semantics/resolve-names.cpp
5897

There are a couple of reasons it's easier to do it here:

  • we need to track implicit type information by scope and implict none(external) goes along with that
  • if a procedure is implicitly external we add the EXTERNAL attribute (line 5860) so we have lost the distinction between implicitly and explicitly external
This revision was automatically updated to reflect the committed changes.
tskeith marked an inline comment as done.