[flang] Consolidate and enhance pointer assignment checks
authorPeter Klausler <pklausler@nvidia.com>
Thu, 16 Mar 2023 19:41:25 +0000 (12:41 -0700)
committerPeter Klausler <pklausler@nvidia.com>
Mon, 27 Mar 2023 23:19:54 +0000 (16:19 -0700)
commit1fa9ef620ba61c800040091b97acc26cbaa6d2f4
treed860eb8971b9ddb927088dbc91d817edbeabca5c
parentc44d307c550b8fe876e52e034471068928b46b4e
[flang] Consolidate and enhance pointer assignment checks

Consolidate aspects of pointer assignment & structure constructor pointer component
checking from Semantics/assignment.cpp and /expression.cpp into /pointer-assignment.cpp,
and add a warning about data targets that are not definable objects
but not hard errors.  Specifically, a structure component pointer component data
target is not allowed to be a USE-associated object in a pure context by a numbered
constraint, but the right-hand side data target of a pointer assignment statement
has no such constraint, and that's the new warning.

Differential Revision: https://reviews.llvm.org/D146581
13 files changed:
flang/lib/Semantics/assignment.cpp
flang/lib/Semantics/check-call.cpp
flang/lib/Semantics/expression.cpp
flang/lib/Semantics/pointer-assignment.cpp
flang/test/Semantics/assign14.f90 [new file with mode: 0644]
flang/test/Semantics/associate01.f90
flang/test/Semantics/c_f_pointer.f90
flang/test/Semantics/call05.f90
flang/test/Semantics/call07.f90
flang/test/Semantics/call33.f90
flang/test/Semantics/structconst03.f90
flang/test/Semantics/structconst04.f90
flang/test/Semantics/structconst07.f90# [new file with mode: 0644]