[Bug fortran/40039] Procedures as actual arguments: Check intent of arguments

janus at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed May 13 17:16:00 GMT 2009



------- Comment #3 from janus at gcc dot gnu dot org  2009-05-13 17:15 -------

> FAIL: gfortran.dg/interface_19.f90  -O0  (test for excess errors)
> FAIL: gfortran.dg/proc_ptr_result_1.f90  -O0  (test for excess errors)
> 
> The last of these three test cases is probably invalid, the second failure
> seems to be a problem with intrinsics, and about the first one I'm not sure.

For intrinsics, the intent of the arguments is currently not considered at all.
We need gfc_intrinsic_arg to have an 'intent' member. The F03 standard says:   

The dummy arguments of the specific intrinsic procedures in 13.6 have
INTENT(IN). The dummy arguments of the generic intrinsic procedures in 13.7
have INTENT(IN) if the intent is not stated explicitly.

The test case proc_ptr_result_1.f90 is invalid indeed. Relevant quote from the
standard:

Section 5.1.2.7:
INTENT (INOUT) is not equivalent to omitting the INTENT attribute. The argument
corresponding to an INTENT (INOUT) dummy argument always shall be definable,
while an argument corresponding to a dummy argument without an INTENT attribute
need be definable only if the dummy argument is actually redefined.


-- 


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



More information about the Gcc-bugs mailing list