[flang] Make uninitialized allocatable components explicitly NULL() in structure...
commit96aa48100c0b332b6e6821b664ad2fa5615c976a
authorPeter Klausler <pklausler@nvidia.com>
Mon, 28 Feb 2022 18:24:58 +0000 (28 10:24 -0800)
committerPeter Klausler <pklausler@nvidia.com>
Tue, 8 Mar 2022 00:41:38 +0000 (7 16:41 -0800)
tree32acc600e5ef5bec24c2a519f80fa99c78cadcae
parent79a1f3e7c6d338b953b4dfe8cd7cb13ba60fe4e7
[flang] Make uninitialized allocatable components explicitly NULL() in structure constructors

When a structure constructor does not initialize an allocatable component,
ensure that the typed expression representation contains an explicit
NULL() for the component.  Expression semantics already copies default
initialized expressions for nonallocatable components into structure
constructors.  This change is expected to simplify lowering.

Differential Revision: https://reviews.llvm.org/D121162
flang/lib/Evaluate/check-expression.cpp
flang/lib/Semantics/expression.cpp
flang/test/Semantics/modfile45.f90 [new file with mode: 0644]
flang/test/Semantics/oldparam02.f90