This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]