[all-commits] [llvm/llvm-project] 85a40c: [flang] Better error message for NULL() actual arg...

Peter Klausler via All-commits all-commits at lists.llvm.org
Mon Jul 25 10:10:13 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 85a40ce6ddf6abf06886dc594aeb998e05f75faa
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2022-07-25 (Mon, 25 Jul 2022)

  Changed paths:
    M flang/docs/Extensions.md
    M flang/lib/Semantics/check-call.cpp
    A flang/test/Semantics/call27.f90

  Log Message:
  [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

More information about the All-commits mailing list