[Fortran, Patch] PR33231 - elemental subroutine: intent out needs an array if any actual argument is an array

Dominique Dhumieres dominiq@lps.ens.fr
Tue Sep 18 08:32:00 GMT 2007


Tobias,

I have applied your patch on top of r128553 and I got the
following failure:

PASS: gfortran.dg/elemental_optional_args_1.f90  -O   (test for warnings, line 25)
PASS: gfortran.dg/elemental_optional_args_1.f90  -O   (test for warnings, line 29)
PASS: gfortran.dg/elemental_optional_args_1.f90  -O   (test for warnings, line 33)
FAIL: gfortran.dg/elemental_optional_args_1.f90  -O   (test for warnings, line 37)
PASS: gfortran.dg/elemental_optional_args_1.f90  -O  (test for excess errors)

due to the fact that gfortran does not give the fourth warning. Note that
the unpatched test gives this warning plus two errors:

Error: Actual argument at (1) for INTENT(OUT) dummy 'b1' of ELEMENTAL subroutine 'foobar' is a scalar, but another actual argument is an array

I also had a look at the warning and I find it quite odd:

Warning: 'a3' at (1) is an array and OPTIONAL; IF IT IS MISSING, it cannot be the actual argument of an ELEMENTAL procedure unless there is a non-optional argument with the same rank (12.4.1.5)

what is the meaning of "IF IT IS MISSING, it cannot be"? is there a NOT missing?

Dominique



More information about the Gcc-patches mailing list