This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/46952] [OOP] Spurious "recursive call" error with type bound procedure
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 15 Dec 2010 08:38:01 +0000
- Subject: [Bug fortran/46952] [OOP] Spurious "recursive call" error with type bound procedure
- Auto-submitted: auto-generated
- References: <bug-46952-4@http.gcc.gnu.org/bugzilla/>
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