This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/46952] [OOP] Spurious "recursive call" error with type bound procedure


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46952

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-12-15 08:37:42 UTC ---
Reduced test case. Crucial seems to be that "inter" and "bar" call "foo" and
that foo and bar are defined via the interface "inter".

Similarly to gfortran and ifort also Crayftn rejects the following program.
However, I do no see any possibility how one could create a recursive call.
Thus, I do not see the need for a RECURSIVE attribute ("The RECURSIVE
prefix-spec shall appear if any procedure defined by the subprogram directly or
indirectly invokes itself or any other procedure defined by the subprogram.")

module m
  type, abstract :: t
  contains
    procedure(inter), pass, deferred :: foo
    procedure(inter), pass, deferred :: bar
  end type
  type,extends(t) :: t2
  contains
    procedure, pass :: bar => bar
    procedure, pass :: foo => foo
  end type t2
contains
  subroutine inter(this)
    class(t) :: this
    call this%foo()
  end subroutine inter
  subroutine foo(this)
    class(t2) :: this
  end subroutine foo
  subroutine bar(this)
    class(t2) :: this
    call this%foo()
  end subroutine
end module m


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]