This is an archive of the discontinued LLVM Phabricator instance.

[flang] Relax ALLOCATABLE/POINTER actual argument checks under INTENT(IN)
ClosedPublic

Authored by klausler on Jun 1 2023, 2:34 PM.

Details

Summary

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.

Diff Detail

Event Timeline

klausler created this revision.Jun 1 2023, 2:34 PM
Herald added a project: Restricted Project. · View Herald Transcript
klausler requested review of this revision.Jun 1 2023, 2:34 PM
vzakhari accepted this revision.Jun 1 2023, 6:19 PM

Thank you! Looks great!

This revision is now accepted and ready to land.Jun 1 2023, 6:19 PM