[flang] Better error message for NULL() actual argument for dummy allocatable
authorPeter Klausler <pklausler@nvidia.com>
Mon, 18 Jul 2022 17:27:05 +0000 (10:27 -0700)
committerPeter Klausler <pklausler@nvidia.com>
Mon, 25 Jul 2022 17:09:55 +0000 (10:09 -0700)
commit85a40ce6ddf6abf06886dc594aeb998e05f75faa
treed1620d10686a8f03e7ae24165cef4efa710d12d9
parent2c84b92346bc45a88f92d781e30daa8490049c4d
[flang] Better error message for NULL() actual argument for dummy allocatable

f18 intentionally does not support the spottily-implemented language extension
in which one can pass NULL() for an allocatable dummy argument.  This is perhaps
a sanctioned side effect in other compilers of the fact that they pass distinct
"base address" and "descriptor address" physical arguments.

Make the error message in this case more specific to the circumstances, and
add a note to Extensions.md to clarify that this behavior is intended.

(We could, with some effort in lowering, support passing NULL for an INTENT(IN)
allocatable dummy, but let's see whether such nonconforming usage appears
in a real application before spending any more time on it.)

Differential Revision: https://reviews.llvm.org/D130380
flang/docs/Extensions.md
flang/lib/Semantics/check-call.cpp
flang/test/Semantics/call27.f90 [new file with mode: 0644]