This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, Fortran, Committed] PR34689 - Fix INTENT(OUT) check for result variables as argument
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, "'fortran at gcc dot gnu dot org'" <fortran at gcc dot gnu dot org>
- Date: Sun, 6 Jan 2008 15:08:40 -0500
- Subject: Re: [Patch, Fortran, Committed] PR34689 - Fix INTENT(OUT) check for result variables as argument
- References: <47812FEC.8020809@net-b.de>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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