Relax restrictions on actual argument for allocatable polymorphic dummy argument with intent(in) and intent(out) #242
Labels
Clause 8
Standard Clause 8: Attribute declarations and specifications
If I'm reading the standard correctly, then section 12.5.2.5 §2 puts restrictions on actual arguments where the dummy argument is allocatable and polymorphic:
and the following Note 12.27:
I believe this is too restrictive for arguments with
intent(in)
andintent(out)
:When the intent is
in
then it is sufficient that the actual argument is type compatible with the dummy argument as noallocate
or redefinition can take place (though anallocated
check can). This will also make the use of a dummyallocatable
consistent with a dummyoptional
.When the intent is
out
then it is sufficient that the actual argument is type compatible with the dummy argument because the dummy argument can (should) not be used before it has been allocated inside the subprogram.Here is a simple example that illustrates how the latter could be useful:
The text was updated successfully, but these errors were encountered: