[flang] Enforce more restrictions on I/O data list items
authorPeter Klausler <pklausler@nvidia.com>
Wed, 30 Nov 2022 23:20:49 +0000 (15:20 -0800)
committerPeter Klausler <pklausler@nvidia.com>
Sat, 3 Dec 2022 00:10:52 +0000 (16:10 -0800)
commit5ea0ba2c13af3c6c8e68701b00695f0f0481bed0
treeb3806e8787899fe263911dc4a81685a1af241fa6
parentb46902117c376ba3990a744cc84f55e191d6e922
[flang] Enforce more restrictions on I/O data list items

12.6.3p5 requires an I/O data list item to have a defined I/O procedure
if it is polymorphic.  (We could defer this checking to the runtime,
but no other Fortran compiler does so, and we would also have to be
able to catch the case of an allocatable or pointer direct component
in the absence of a defined I/O subroutine.)

Also includes a patch to name resolution that ensures that a
SELECT TYPE construct entity is polymorphic in the domain of a
CLASS IS guard.

Also ensures that non-defined I/O of types with PRIVATE components
is caught.

Differential Revision: https://reviews.llvm.org/D139050
flang/include/flang/Semantics/semantics.h
flang/include/flang/Semantics/tools.h
flang/lib/Semantics/check-io.cpp
flang/lib/Semantics/check-io.h
flang/lib/Semantics/resolve-names.cpp
flang/lib/Semantics/tools.cpp
flang/test/Semantics/io12.f90
flang/test/Semantics/io14.f90 [new file with mode: 0644]
flang/test/Semantics/io15.f90 [new file with mode: 0644]
flang/test/Semantics/symbol11.f90