[flang] Prohibit MODULE procedures in the global scope
authorPeter Steinfeld <psteinfeld@nvidia.com>
Wed, 3 Mar 2021 18:52:40 +0000 (10:52 -0800)
committerPeter Steinfeld <psteinfeld@nvidia.com>
Wed, 3 Mar 2021 19:50:50 +0000 (11:50 -0800)
commit1c2935a7729fdc22186fa0a21968061a7f52f021
treec6efb63cb7205e63adba16fa1a168b112cb5737f
parent83c56aa4ee82acb63327f96f502c4778d972b412
[flang] Prohibit MODULE procedures in the global scope

We were allowing procedures with the MODULE prefix to be declared at the global
scope.  This is prohibited by C1547 and was causing an internal check of the
compiler to fail.

I fixed this by adding a check.  I also added a test that would trigger a crash
without this change.

Differential Revision: https://reviews.llvm.org/D97875
flang/lib/Semantics/resolve-names.cpp
flang/test/Semantics/resolve36.f90