[flang] Create symbols for args of separate-module-subprogram
authorTim Keith <tkeith@nvidia.com>
Tue, 17 Mar 2020 21:28:08 +0000 (14:28 -0700)
committerTim Keith <tkeith@nvidia.com>
Tue, 17 Mar 2020 23:01:59 +0000 (16:01 -0700)
commit824d198e3147611ca4f11fe3fb96c994d51fbbdf
tree87c84f9f3a1c7a95babd5e5e46488ebe34fa3a62
parentd1ce4d275f6a64c1cbe83d42ba56a99e9ee87a39
[flang] Create symbols for args of separate-module-subprogram

A separate-module-subprogram is declared as `module procedure ...`
and gets its characteristics from the declaration of that name as
a separate module procedure. When we encounter one, we need to create
symbols in the new subprogram scope for the dummy arguments and
function return (if any).

The failure to create these symbols led to the bug in issue flang-compiler/f18#1054:
when a dummy argument was referenced, the compiler interpreted it as
an implicit declaration because there was no symbol for the argument.

Fixes flang-compiler/f18#1054.

Original-commit: flang-compiler/f18@4d3c4bac843dcc6351fbe7538c6ce23bb9c1a215
Reviewed-on: https://github.com/flang-compiler/f18/pull/1080
Tree-same-pre-rewrite: false
flang/include/flang/Semantics/scope.h
flang/lib/Semantics/resolve-names.cpp
flang/lib/Semantics/scope.cpp
flang/test/Semantics/resolve76.f90 [new file with mode: 0644]