[PATCH] fortran/45495 -- optional dummy args cannot not be in restricted expressions

Steve Kargl sgk@troutmask.apl.washington.edu
Thu Sep 2 22:51:00 GMT 2010


A specification expression is an expression with limitations
that make it suitable for use in specifications such as length
type parameters (C501) and array bounds (R512, R513).

R729  specification-expr          is   scalar-int-expr

C710  (R729) The scalar-int-expr shall be a restricted expression.

A restricted expression is an expression in which each operation
is intrinsic and each primary is
...
  (2)  An object designator with a base object that is a dummy
       argument that has neither the OPTIONAL nor the INTENT(OUT)
       attribute,

The attach patch enforces the above restriction.  It has been
built and regression tested on x86_64-*-freebsd.  OK for trunk?


2010-09-02  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/45495
	* gfortran.dg/dummy_optional_arg.f90: New test.

2010-09-02  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/45495
	* fortran/expr.c (check_inquiry): Optional dummy argument are not
	permitted in a restricted expression.

-- 
Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr45495.diff
Type: text/x-diff
Size: 1182 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20100902/6f511b38/attachment.bin>


More information about the Fortran mailing list