[Patch, fortran] PR20893 - unconditional use of optional argument not detected
Paul Thomas
paulthomas2@wanadoo.fr
Tue Jul 11 14:34:00 GMT 2006
:ADDPATCH fortran:
Once more, the standard:
/* If it(the arg) 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(12.4.1.5). */
The patch to do this has been accomplished by drawing together the
resolution of elemental functions and subroutines into a single
function. The implementation of the above is then straightforward,
except for the different representations of elemental intrinsic
functions, non-intrinsic elemental functions and elemental subroutines.
However, this is a matter of perspiration rather than any intellectual
stress. Similarly, the testcase makes sure that the error is picked up
in each case and that which should work is not broken.
Regtested on FC5/Athlon. OK for trunk and 4.1?
Paul
2006-07-11 Paul Thomas <pault@gcc.gnu.org>
PR fortran/20893
* resolve.c (resolve_elemental_actual): New function t combine
all the checks of elemental procedure actual arguments. In
addition, check of array valued optional args(this PR) has
been added.
(resolve_function, resolve_call): Remove parts that treated
elemental procedure actual arguments and call the above.
2006-07-11 Paul Thomas <pault@gcc.gnu.org>
PR fortran/20893
* gfortran.dg/elemental_optional_args_1.f90: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr20893.diff
Type: text/x-patch
Size: 7562 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060711/534cfb2e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: elemental_optional_args_1.f90
Type: text/x-fortran
Size: 1768 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060711/534cfb2e/attachment-0001.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Change.Logs
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060711/534cfb2e/attachment.ksh>
More information about the Fortran
mailing list