[gfortran, PR20851] Disallow dummy arguments in init exprs in elemental procedures
Tobias Schlüter
tobias.schlueter@physik.uni-muenchen.de
Sun Oct 7 11:21:00 GMT 2007
Hi,
this turned out much easier than I thought it would.
Quoting from the standard:
"A dummy argument, or a subobject thereof, shall not appear in
aspecification-expr except as the argument to one of the intrinsic
functions BIT_SIZE, KIND, LEN, or the numeric inquiry functions (13.11.8)."
The functions in 13.11.8 are: DIGITS, EPSILON, HUGE, MAXEXPONENT,
MINEXPONENT,
PRECISION, RADIX, RANGE, TINY.
Fixing this issue turned out to be very simple, because valid
expressions are folded by the simplifiers, i.e. the dummy argument
doesn't appear in their simplified versions.
The change to resolve_fl_variable() was necessary to avoid a double
error message being printed: is_non_constant_shape_array(), in spite of
its name suggesting otherwise, has side-effects and may issue errors,
therefore I moved it to the end of the logical expressions in order to
ensure that it's only called in cases where its result is important.
Built and tested on i686-darwin. Ok?
Cheers,
- Tobi
:ADDPATCH fortran:
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pr20851.diff.txt
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20071007/21dce25a/attachment.txt>
More information about the Fortran
mailing list