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

           Summary: ICE as a consequence of invalid source code attempting
                    to register a type-bound procedure
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: arjen.mar...@deltares.nl


The code below produces an ICE after reporting that assign_square must be a
module procedure or an external procedure. It seems related to bug #46849

module geometrical_objects

   implicit none

   type, abstract :: shape
   end type shape

   type, extends(shape) :: rectangle
       real :: width, height
   end type rectangle

   type, extends(rectangle) :: square
   contains
       procedure ::  assign_square
   end type square

contains

  subroutine assign_rectangle( this, that )
    class(shape),     intent(inout) :: this
    class(rectangle), intent(in)    :: that
    select type( that )
      class is (rectangle)
    end select
  end subroutine assign_rectangle

  subroutine assign_square( this, that )
    class(shape),  intent(inout) :: this
    class(square), intent(in)    :: that
  end subroutine assign_square

end module geometrical_objects

Reply via email to