[flang] Extension: forward refs to dummy args under IMPLICIT NONE
authorpeter klausler <pklausler@nvidia.com>
Thu, 18 Feb 2021 19:55:31 +0000 (11:55 -0800)
committerpeter klausler <pklausler@nvidia.com>
Thu, 18 Feb 2021 21:14:34 +0000 (13:14 -0800)
commitea2ff54ccc22f86f95e989d47daa669e0af950a8
tree6fddf11c508877d128fd0fdf03b1194af4fc9283
parent4cf3c35c10470b3ffca201c4a529428efd5462c1
[flang] Extension: forward refs to dummy args under IMPLICIT NONE

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.

Differential Revesion: https://reviews.llvm.org/D96982
flang/docs/Extensions.md
flang/include/flang/Common/Fortran-features.h
flang/lib/Semantics/resolve-names.cpp
flang/test/Semantics/assign04.f90
flang/test/Semantics/resolve103.f90 [new file with mode: 0644]