[flang-commits] [PATCH] D151941: [flang] Relax ALLOCATABLE/POINTER actual argument checks under INTENT(IN)

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Thu Jun 1 14:34:49 PDT 2023


klausler created this revision.
klausler added a reviewer: vzakhari.
klausler added a project: Flang.
Herald added subscribers: sunshaoce, jdoerfert.
Herald added a reviewer: sscalpone.
Herald added a project: All.
klausler requested review of this revision.

Per 15.5.2.5 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.


https://reviews.llvm.org/D151941

Files:
  flang/include/flang/Common/Fortran-features.h
  flang/lib/Semantics/check-call.cpp
  flang/test/Semantics/call36.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151941.527626.patch
Type: text/x-patch
Size: 5346 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230601/1f4e3428/attachment.bin>


More information about the flang-commits mailing list