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

--- Comment #3 from guido <g.granda at irya dot unam.mx> ---
Hello Kargl,
Thank you a lot! The problem was that I was calling the 
heat_function_field incorrectly. I forgot to put the "()" and the error 
message wasn't that helpful. Therefore this is not a bug at all.
Cheers,


On 2019-04-22 00:04, kargl at gcc dot gnu.org wrote:
> 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