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/42769] [OOP] ICE in resolve_typebound_procedure



------- 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


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