https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90198
--- Comment #2 from kargl at gcc dot gnu.org ---
Reduced testcase.

program test

   implicit none

   contains

      real function  foo(temp)
         real, intent(in) :: temp
         foo=bah()*(2)
      end function foo

      real function bar(temp,nh)
         real,intent(in):: temp,nh
         bar = 2 * bah              ! Danger Will Roberson!
      end function bar

      real function bah()
         bah = 1
      end function bah

end program

The problem is that bah is referenced in bar() as a variable.  Later,
we find that bah is defined as a function.  gfortran chokes on this.

Note, if the function bah() were moved in front of the function
bar(), then gfortran generates

a.f90:18:36:

   18 |          bar = 2 * bah              ! Danger Will Roberson!
      |                                    1
Error: Function 'bah' requires an argument list at (1)

Reply via email to