[flang] Handle structure constructors with forward references to PDTs
authorPeter Steinfeld <psteinfeld@nvidia.com>
Mon, 26 Apr 2021 22:20:22 +0000 (15:20 -0700)
committerPeter Steinfeld <psteinfeld@nvidia.com>
Tue, 27 Apr 2021 19:46:05 +0000 (12:46 -0700)
commit8b550af7a9cf363d382b7042f12ab24aa13711fc
treed6fda74b7c6685aac7a378c5cdb845a665363226
parent9c552d27ee03ad485c2d36827e73bea75faee5e1
[flang] Handle structure constructors with forward references to PDTs

We were not correctly handling structure constructors that had forward
references to parameterized derived types.  I harvested the code that checks
for forward references that was used during analysis of function call
expressions and called it from there and also called it during the
analysis of structure constructors.

I also added a test that will produce an internal error without this change.

Differential Revision: https://reviews.llvm.org/D101330
flang/include/flang/Semantics/expression.h
flang/lib/Semantics/expression.cpp
flang/test/Semantics/bad-forward-type.f90