https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58002

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
The test

   Module m200c2
     Integer,Target :: x = 42
   Contains
     Function fx()
       Integer,Pointer :: fx
       fx => x
     End Function
   End Module

   Program q1
     Use m200c2
     Call test(x,fx())                  ! The call.
   Contains
     Subroutine test(a,b)
       Integer :: a,b
       a = a*10                         ! The assignment.
       Print *,a,b
     End Subroutine
   End Program

outputs 

         420         420

Am I correct to understand that this answer is OK for Fortran 2008, but should
be

         420         42

for Fortran 2003 and older?

Note that if I replace the line

     Call test(x,fx())                  ! The call.

with

     Call test(x,(fx()))                  ! The call.

I get the later answer.

Reply via email to