This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Fortran, Patch] PR33231 - elemental subroutine: intent out needs an array if any actual argument is an array
- From: dominiq at lps dot ens dot fr (Dominique Dhumieres)
- To: fortran at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 18 Sep 2007 08:15:49 +0200
- Subject: Re: [Fortran, Patch] PR33231 - elemental subroutine: intent out needs an array if any actual argument is an array
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