[flang] Be more precise about CHARACTER known length discrepancies
authorPeter Klausler <pklausler@nvidia.com>
Thu, 13 Oct 2022 22:22:55 +0000 (15:22 -0700)
committerPeter Klausler <pklausler@nvidia.com>
Mon, 31 Oct 2022 18:18:16 +0000 (11:18 -0700)
commitd9232e394e08ecba3d8e4128a11d30d9aa20605d
treea857b19f90e4b591d85634deeb0d8b857273c6ee
parent93798fb740d342a90c47aa547656bae8dd47d017
[flang] Be more precise about CHARACTER known length discrepancies

Many intrinsic functions in Fortran require that two or more of their
arguments have types that agree in the values of all of their type
parameters, while others only require the same type category and kind
type parameters but not lengths, including the important case of
CHARACTER.  The intrinsic procedure tables need to be adjusted in
some cases so that discrepancies in character lengths that are known
at compilation time can be diagnosed as errors where they should be,
as in for example MOVE_ALLOC().

Differential Revision: https://reviews.llvm.org/D137032
flang/include/flang/Evaluate/type.h
flang/lib/Evaluate/intrinsics.cpp
flang/lib/Evaluate/type.cpp
flang/test/Evaluate/folding23.f90
flang/test/Semantics/move_alloc.f90