[flang] Refine "same type" testing for intrinsic arguments (#125133)
commitf8300f1c2a767e2ffaa6440249439b66bb5dec3b
authorPeter Klausler <pklausler@nvidia.com>
Fri, 31 Jan 2025 18:55:08 +0000 (31 10:55 -0800)
committerGitHub <noreply@github.com>
Fri, 31 Jan 2025 18:55:08 +0000 (31 10:55 -0800)
tree7513c15a1c5ba990121f9ee24f31e0d8f263c35c
parent56c468474de77cd7b6954a74190f9603d393d02a
[flang] Refine "same type" testing for intrinsic arguments (#125133)

Some errors aren't being caught, such as the case in the linked bug
where the PAD= argument to RESHAPE() didn't have the same declared type
as the ARRAY=; this led to a crash in lowering. Refine the "same type"
testing logic for intrinsic procedures, and add a better test.

Fixes https://github.com/llvm/llvm-project/issues/124976.
flang/lib/Evaluate/intrinsics.cpp
flang/lib/Semantics/resolve-names.cpp
flang/test/Semantics/bug124976.f90 [new file with mode: 0644]