[Bug fortran/94909] New: Rejects valid code for recursion where there is none

neil.n.carlson at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri May 1 19:27:51 GMT 2020


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

            Bug ID: 94909
           Summary: Rejects valid code for recursion where there is none
           Product: gcc
           Version: 9.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: neil.n.carlson at gmail dot com
  Target Milestone: ---

The compiler rejects the following valid code that contains no recursion.

module example
  type, abstract :: foo
  contains
    procedure :: dot
    procedure(dot), deferred :: dot_
  end type
contains
  function dot(a, b)
    class(foo) :: a, b
    dot = a%dot_(b)
  end function
end module

$ gfortran -c gfortran-20200501.f90 
gfortran-20200501.f90:13:10:

   13 |     dot = a%dot_(b)
      |          1
Error: Function ‘dot’ at (1) cannot be called recursively, as it is not
RECURSIVE


More information about the Gcc-bugs mailing list