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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Not crashing but giving an odd error message is the following (for 'g'):

program m
  implicit none
  print *, f(3)
  print *, g(3)
contains
  recursive integer function f(n)
    integer, value :: n
    if (n == 0) then
      f = 1
    else
      f = n * f (n-1)  ! Error: … name of a recursive function and so refers to
the result variable.
    end if
  end function f
  recursive integer function f(n)
    integer, value :: n
    if (n == 0) then
      f = 1
    else
      associate (x => f(n-1))
        f = n * x  ! Error: Operands of binary numeric operator ‘*’ at (1) are
INTEGER(4)/PROCEDURE
      end associate
    end if
  end function f
end program m

Reply via email to