[flang] Allow modification of construct entities
authorPeter Klausler <pklausler@nvidia.com>
Tue, 5 Apr 2022 20:42:12 +0000 (13:42 -0700)
committerPeter Klausler <pklausler@nvidia.com>
Thu, 14 Apr 2022 23:58:08 +0000 (16:58 -0700)
commit625dedc3fe60f1b1010a96c9fee43119f6dfe121
tree3aa7df061978880ed7d30ef7860109d1e663f812
parentaf91446aa2903324c81d9e0b0a8a9fc037edc1a4
[flang] Allow modification of construct entities

Construct entities from ASSOCIATE, SELECT TYPE, and SELECT RANK
are modifiable if the are associated with modifiable variables
without vector subscripts.  Update WhyNotModifiable() to accept
construct entities that are appropriate.

A need for more general error reporting from one overload of
WhyNotModifiable() caused its result type to change to
std::optional<parser::Message> instead of ::MessageFixedText,
and this change had some consequences that rippled through
call sites.

Some test results that didn't allow for modifiable construct
entities needed to be updated.

Differential Revision: https://reviews.llvm.org/D123722
flang/include/flang/Semantics/tools.h
flang/lib/Semantics/check-omp-structure.cpp
flang/lib/Semantics/resolve-names.cpp
flang/lib/Semantics/tools.cpp
flang/test/Semantics/modifiable01.f90
flang/test/Semantics/resolve57.f90
flang/test/Semantics/selecttype03.f90