[Bug fortran/28548] [4.2 Regression]: Optional argument failed

martin at mpa-garching dot mpg dot de gcc-bugzilla@gcc.gnu.org
Thu Aug 3 06:22:00 GMT 2006



------- Comment #7 from martin at mpa-garching dot mpg dot de  2006-08-03 06:22 -------
(In reply to comment #3)
> Andrew, I think it is a bug.  The language in section 12.4.1.5 is somewhat
> convoluted and the description of PRESENT() suggest that PRESENT is special.
> 
> From 12.4.1.5:
> 
>    An optional dummy argument that is not present is subject to the
>    following restrictions:
> 
>    (3)  It shall not be supplied as an actual argument corresponding to
>         a nonoptional dummy argument other than as the argument of the
>         PRESENT intrinsic function.
> 
>    (5)  If it is an array, it shall not be supplied as an actual argument
>         to an elemental procedure unless an array of the same rank is
>         supplied as an actual argument corresponding to a nonoptional dummy
>         argument of that elemental procedure.

My understanding of this is that the error message given by gfortran is wrong,
even if an elemental procedure is called with the optional array. The clauses
only refer to an optional argument _that is not present_, but in the given
testcases the calls only happen if it is present.
I think that 12.1.4.5. can only describe a runtime error condition, and cannot
generally be detected at compile time.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28548



More information about the Gcc-bugs mailing list