[flang] Fix defined I/O semantics crash & missing errors that exposed it
authorPeter Klausler <pklausler@nvidia.com>
Fri, 13 Jan 2023 22:33:57 +0000 (14:33 -0800)
committerPeter Klausler <pklausler@nvidia.com>
Sun, 29 Jan 2023 18:15:27 +0000 (10:15 -0800)
commit042c964d607f834d1a70763caa47492ba770c3c8
tree47f8f887024f7f046e10fe3825f6e11f5a7f10a3
parent9601d105de3025d3be668d017dd194a24cdc09f4
[flang] Fix defined I/O semantics crash & missing errors that exposed it

Semantics crashes when emitting runtime derived type information tables
for a type that has user-defined I/O procedures declared outside the
type with explicit INTERFACE blocks (as opposed to a GENERIC binding
within the type).  This is due to the runtime table constructor
adding a table entry for each specific procedure of any explicit interface
 of the right kind (e.g., READ(UNFORMATTED)) that it found, rather than
just the ones that pertain to the derived type in question.  But
semantics also wasn't checking such interfaces for distinguishable
specific procedures, either.

Clean these up, improve the spelling of defined I/O procedure kinds
in error messages ("read(formatted)" rather than "READFORMATTED"),
and make error messages stemming from macro expansions only have
one "error:" prefix on the original message so that a new test
would work.

Differential Revision: https://reviews.llvm.org/D142769
flang/lib/Decimal/big-radix-floating-point.h
flang/lib/Evaluate/characteristics.cpp
flang/lib/Parser/provenance.cpp
flang/lib/Semantics/check-declarations.cpp
flang/lib/Semantics/runtime-type-info.cpp
flang/test/Semantics/generic05.F90 [new file with mode: 0644]
flang/test/Semantics/io11.f90
flang/test/Semantics/resolve65.f90