[Patch, Fortran] PR fortran/35837: Fix type-resolving and gfc_current_ns
Daniel Kraft
d@domob.eu
Sat Sep 6 08:45:00 GMT 2008
Dominique Dhumieres wrote:
> Sorry to be a nuisance, but with the fix the following test which was rejected
> with "Re: [Patch, Fortran] PR fortran/35837: Fix type-resolving and gfc_current_ns"
> now passes (test from comment #1 in pr29389). From the discussion in this pr it
> seems that the code should be rejected as for gfortran.dg/stfunc_6.f90.
>
> Am I missing something? note that Ãg95 has the same behavior while ifort rejects the code
> with "his name does not have a type, and must have an explicit type."
Hi again,
sorry for yet another reply :) I've looked at PR 29389 now, and I can't
really see where there's agreed that your code should be rejected--can
you give me a more detailed pointer, please?
In comment #1, FX states his opinion that the code is valid (which
matches my current understanding) an mentions the gfc_current_ns problem
that my patch fixed and that in consequence also made your code below pass.
If we agree on something here, I think we should either add the test
below to the test-suite or change it to expect an error and I'll fix my
patch.
Cheers,
Daniel
PS: Dominique, thanks for the very quick testing!
> implicit none
> INTEGER :: st1,i,a(4)
> st1(i)=i*i*g(i)
> !FORALL(i=1:4) a(i)=st1(i)
> print *, a
> print *, u(2)
>
> contains
>
> pure integer function u(x)
> integer :: st2, i
> integer,intent(in) :: x
>
> st2(i) = i*i
> u = st2(x)
> end function
>
> pure integer function f(x)
> integer,intent(in) :: x
> f = x
> end function
>
> integer function g(x)
> integer,intent(in) :: x
> g = x
> end function
> end
>
--
Done: Arc-Bar-Cav-Sam-Val-Wiz, Dwa-Elf-Gno-Hum-Orc, Law-Neu-Cha, Fem-Mal
To go: Hea-Kni-Mon-Pri-Ran-Rog-Tou
More information about the Fortran
mailing list