This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/42769] [OOP] ICE in resolve_typebound_procedure
- From: "janus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Aug 2010 13:25:55 -0000
- Subject: [Bug fortran/42769] [OOP] ICE in resolve_typebound_procedure
- References: <bug-42769-9410@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #27 from janus at gcc dot gnu dot org 2010-08-23 13:25 -------
(In reply to comment #24)
> Here is a somewhat modified version of comment #14, which compiles but produces
> wrong code:
The example in comment #24 contains a statically-resolved TBP call (the pass
object is non-polymorphic). One can construct an analogous version with a
polymorphic TBP call, which also fails:
> module mod1
> type :: t1
> contains
> procedure, nopass :: get => my_get
> end type
> contains
> subroutine my_get()
> print *,"my_get (mod1)"
> end subroutine
> end module
>
> module mod2
> contains
> subroutine my_get() ! must have the same name as the function in mod1
> print *,"my_get (mod2)"
> end subroutine
> end module
use mod2
use mod1 ! order of use statements is important
class(t1),allocatable :: a
allocate(a)
call a%get()
end
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42769