[J3] Assumed-type dummy argument descriptor
Malcolm Cohen
malcolm at nag-j.co.jp
Fri Apr 7 06:20:00 UTC 2023
Hi Damien,
Unlimited polymorphic is not just TYPE(*) but also CLASS(*).
C709 is about TYPE(*) only.
CLASS(*) is quite often ALLOCATABLE.
Cheers,
--
..............Malcolm Cohen, NAG Oxford/Tokyo.
From: J3 <j3-bounces at mailman.j3-fortran.org> On Behalf Of Damian Rouson via J3
Sent: Friday, April 7, 2023 1:59 PM
To: fortran standards email list for J3 <j3 at mailman.j3-fortran.org>
Cc: Damian Rouson <rouson at lbl.gov>
Subject: [J3] Assumed-type dummy argument descriptor
Clause 16.9.284 of the Fortran 2018 standard defines the STORAGE_SIZE() intrinsic function. In describing the function's one non-optional argument, the standard states, "If it is unlimited polymorphic or has any deferred type parameters, it shall not be an unallocated allocatable variable or a disassociated or undefined pointer." Constraint C709 stipulates "An assumed-type entity shall be a dummy data object that does not have the ALLOCATABLE, CODIMMENSION, INTENT (OUT), POINTER, or VALUE attribute and is not an explicit-shape array."
Given that an assumed-type dummy data object cannot have the ALLOCATABLE attribute, it seems that STORAGE_SIZE() definition must be referring to the actual argument. What would be the point in stipulating that an unlimited polymorphic data object shall not be an unallocated allocatable variable if it can't have the allocatable attribute? I think this suggests that the CFI_cdesc_t descriptor describes the actual argument associated with an unlimited polymorphic dummy argument. I know there was a related debate at the most recent J3 meeting, but I don't know the outcome.
Damian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20230407/8650c1d8/attachment.htm>
More information about the J3
mailing list