[flang] Always diagnose incompatible function results when associating function pointers
authorPeter Klausler <pklausler@nvidia.com>
Wed, 12 Oct 2022 19:59:48 +0000 (12:59 -0700)
committerPeter Klausler <pklausler@nvidia.com>
Mon, 31 Oct 2022 17:41:27 +0000 (10:41 -0700)
commitb22873b18cd81529623566fd13ef90cdb48c6ee7
tree9d1e213da81888f46bd07f052851d957d1c7a211
parentf94c2679cb1db92ce4103487bf0247eca6e4d722
[flang] Always diagnose incompatible function results when associating function pointers

There are some exceptional cases where the compiler permits association of
procedure pointers or dummy arguments with slightly incompatible procedure
targets, but they should not override any incompatibilty of function
result types.

(Includes a second fix to resolve the original motivating test failure, in
which a COMPLEX intrinsic function was getting its result kind divided by
two due to an implicit C++ conversion of the kind to a "*kind" parse tree
node, and those legacy "COMPLEX*size" type designators' values are twice
the type kind value.)

Differential Revision: https://reviews.llvm.org/D136964
flang/include/flang/Semantics/symbol.h
flang/lib/Evaluate/tools.cpp
flang/lib/Semantics/resolve-names.cpp
flang/lib/Semantics/symbol.cpp
flang/test/Semantics/assign03.f90
flang/test/Semantics/associated.f90
flang/test/Semantics/resolve46.f90