[flang] Diagnose invalid initializations
authorPeter Klausler <pklausler@nvidia.com>
Tue, 10 Jan 2023 22:30:27 +0000 (14:30 -0800)
committerPeter Klausler <pklausler@nvidia.com>
Sun, 29 Jan 2023 01:00:28 +0000 (17:00 -0800)
commit034bab4cc83d86cfb334bada488b88bf761a1e71
tree9b3c59757b179ba084ba3d4767fc96fd456b6bc1
parent9a22aeb91d415b9c0e354e78a26a98f3d5c07f1a
[flang] Diagnose invalid initializations

f18 current ignores attempts to initialize (with =expr) things
that are not objects, or allows meaningless initializations of
things that have mistakenly been promoted to be objects.
Fix by refusing to promote to objects names that have any
attributes that cannot be applied to objects, and then catch
data initializations of symbols that are not objects.

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