[Bug fortran/49562] New: [OOP] ICE at invalid code: assigning value to function of polymorphic object

boschmann at tp1 dot physik.uni-siegen.de gcc-bugzilla@gcc.gnu.org
Tue Jun 28 08:26:00 GMT 2011


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

           Summary: [OOP] ICE at invalid code: assigning value to function
                    of polymorphic object
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: boschmann@tp1.physik.uni-siegen.de
                CC: janus@gcc.gnu.org


The code:

module ice
  type::ice_type
   contains
     procedure::ice_func
  end type ice_type
contains
  pure integer function ice_func(this)
    class(ice_type),intent(in)::this
    ice_func=1
  end function ice_func
  subroutine ice_sub(a)
    class(ice_type)::a
    a%ice_func()=1           ! This is the invalid line
  end subroutine ice_sub
end module ice

The marked line is obviously not allowed. When I replace class(ice_type)::a by
type(ice_type)::a then get a proper error message, but the class statement
results in an internal compiler error.

My gfortran version is 4.7.0 20110620



More information about the Gcc-bugs mailing list