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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.05.15 13:08:00
            Summary|[OOP] ICE with generic TBP  |[OOP] ALLOCATE with
                   |                            |non-trivial SOURCE
     Ever Confirmed|0                           |1

--- Comment #1 from janus at gcc dot gnu.org 2011-05-15 13:08:00 UTC ---
Reduced test case:


module generic_deferred
  implicit none
  type :: addable
    integer :: i(2)
  contains
    procedure :: add 
  end type
contains
  function add(x, y) result(res)
    class(addable), intent(in) :: x,y
    class(addable), allocatable :: res
    allocate(res)
    res%i = x%i + y%i
  end function
end module

program prog
  use generic_deferred
  implicit none
  type(addable) :: x, y
  class(addable), allocatable :: z
  x = addable((/1,2/))
  y = addable((/2,-2/))
  allocate(z,source=add(x,y))
end program prog


The ICE comes from the ALLOCATE statement.

Reply via email to