[all-commits] [llvm/llvm-project] 9299bd: [flang] Relax ALLOCATABLE/POINTER actual argument ...

Peter Klausler via All-commits all-commits at lists.llvm.org
Fri Jun 2 08:06:38 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9299bde9e3797db3e46938eb7a53191826fb19c1
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2023-06-02 (Fri, 02 Jun 2023)

  Changed paths:
    M flang/include/flang/Common/Fortran-features.h
    M flang/lib/Semantics/check-call.cpp
    A flang/test/Semantics/call36.f90

  Log Message:
  [flang] Relax ALLOCATABLE/POINTER actual argument checks under INTENT(IN)

Per p2, when both a dummy data object and its associated
actual argument are ALLOCATABLE or POINTER, there are rules requiring
that both be unlimited polymorphic if either is, and that both be
polymorphic if either is.  The justifications for the first restriction
is that the called procedure might change the type of an unlimited
polymorphic dummy argument, but as this cannot occur for a dummy
argument with INTENT(IN), we can relax the check to an optional
portability warning.  The justification for the second restriction
is that some implementations would have to create a type descriptor
to associate a monomorphic allocatable/pointer actual argument with
a polymorphic dummy argument, and that doesn't apply to f18 since we
use descriptors for them anyways.

Relaxing these needless checks allows more library procedures to
use "class(*), dimension(..), pointer, intent(in)" dummy arguments
in explicit interfaces.

Differential Revision: https://reviews.llvm.org/D151941

More information about the All-commits mailing list