[flang] Forward references to COMMON from specification expr under IMPLICIT NONE
authorPeter Klausler <pklausler@nvidia.com>
Fri, 3 Mar 2023 19:43:55 +0000 (11:43 -0800)
committerPeter Klausler <pklausler@nvidia.com>
Fri, 10 Mar 2023 17:19:52 +0000 (09:19 -0800)
commitd38765604f9372dab74a82b573302bd6401c6698
treeecc31f0eb63dfeb90b1cb88f954dbbfdd21f50ad
parent30705e977061e437a337070fd6a21c7df2c62670
[flang] Forward references to COMMON from specification expr under IMPLICIT NONE

As a near-universal extension, Fortran compilers permit forward references
to dummy arguments and variables in COMMON blocks from specification expressions
before an explicit type-declaration-stmt appears for those variables
under IMPLICIT NONE, so long as those variables are later explicitly typed
with the types that regular implicit typing rules would have given them
(usually default INTEGER).

F18 implemented this extension for dummy arguments, but not variables in
COMMON blocks.  Extend the extension to also accept variables in COMMON.

Differential Revision: https://reviews.llvm.org/D145743
flang/docs/Extensions.md
flang/include/flang/Common/Fortran-features.h
flang/lib/Semantics/resolve-names.cpp
flang/test/Semantics/implicit11.f90
flang/test/Semantics/resolve103.f90