This is an archive of the discontinued LLVM Phabricator instance.

[flang] Extension: forward refs to dummy args under IMPLICIT NONE
ClosedPublic

Authored by klausler on Feb 18 2021, 11:52 AM.

Details

Reviewers
tskeith
Summary

Most Fortran compilers accept the following benign extension,
and it appears in some applications:

SUBROUTINE FOO(A,N)
  IMPLICIT NONE
  REAL A(N) ! N is used before being typed
  INTEGER N
END

Allow it in f18 only for default integer scalar dummy arguments.

Diff Detail

Event Timeline

klausler created this revision.Feb 18 2021, 11:52 AM
klausler requested review of this revision.Feb 18 2021, 11:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 18 2021, 11:52 AM
tskeith accepted this revision.Feb 18 2021, 12:04 PM
This revision is now accepted and ready to land.Feb 18 2021, 12:04 PM

+1 I have seen this being used in many weather simulation code.

klausler closed this revision.Feb 19 2021, 9:12 AM