[J3] Vector subscripts and INTENT(INOUT)

Rafik Zurob rzurob at ca.ibm.com
Tue May 15 12:46:53 EDT 2018

> I did go back and look at old standards.  F2008, in the “Vector 
> subscript” subclause of 6, has “An array section with a vector 
> subscript shall not be argument associated with a dummy array that 
> is defined or redefined.”.    That is the “shall not” rule that 
> supports the factual claim in the argument association clause that 
> the dummy is undefinable.   The same rule is in all the standards 
> going back to F90.   For some reason it was dropped in the F2018 
> draft, which is the one I was originally reading.  If it was added 
> back into F2018, then there would be a rule-based justification for 
> the claim that the dummy argument is not definable. I would find 
> that a substantial improvement. 

IBM XL Fortran is consistent with the above rule:

$ xlf vectorsubscript.f90 -qsource
          6 |  call sub (dat(iv))
a - "vectorsubscript.f90", line 6.13: 1516-056 (S) An accessible explicit 
interface has a dummy argument with the INTENT(OUT) or INTENT(INOUT) 
attribute specified. Corresponding actual argument which is not definable 
is not permitted in this context.
** test_vector   === End of Compilation 1 ===
1501-511  Compilation failed for file vectorsubscript.f90.

I fully support putting the rule back in F2018 draft. (Or if there is good 
reason for dropping it, I would appreciate learning it.)



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20180515/1e96443d/attachment.html>

More information about the J3 mailing list