[Patch, Fortran, Committed] PR34689 - Fix INTENT(OUT) check for result variables as argument

Jakub Jelinek jakub@redhat.com
Sun Jan 6 22:39:00 GMT 2008


On Sun, Jan 06, 2008 at 08:45:48PM +0100, Tobias Burnus wrote:
> Comitted as obvious (Rev. 131359).
> The attached patch fixes a regression of PR34662. I was checking for
> flavour = FL_VARIABLE, but this fails if the symbol is both a (result)
> variable and the name of a function.
> 
> The initial patch was supposed to give an error for PARAMETERs.
> 
> --- gcc/testsuite/gfortran.dg/intent_out_4.f90	(Revision 0)
> +++ gcc/testsuite/gfortran.dg/intent_out_4.f90	(Revision 0)
> @@ -0,0 +1,18 @@
> +! { dg-do compile }
> +!
> +! PR fortran/34689
> +!
> +! The following (cf. libgomp.fortran/appendix-a/a.33.3.f90)
> +! was rejected because the intent check missed a FL_FUNCTION
> +! for the result variable.
> +!
> +function test()
> +  implicit none
> +  integer :: test
> +  interface
> +    subroutine foo(a)
> +      integer(inout) :: a
> +    end subroutine foo
> +  end interface
> +  call foo(a)

Wasn't this supposed to be call foo(test)?  a isn't defined anywhere
and with implicit none it can't be implicitly typed.

	Jakub



More information about the Fortran mailing list