[Bug fortran/55960] [OOP] ICE in replace_comp, at fortran/expr.c:4356

janus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Jan 13 10:36:00 GMT 2013


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

--- Comment #2 from janus at gcc dot gnu.org 2013-01-13 10:36:22 UTC ---
Yet another variant:


module pdfs
  type, abstract :: pdf
  contains
    procedure(getdims), deferred :: getdims
    procedure(getx), deferred :: getx
  end type pdf

  abstract interface
    pure function getdims(this)
      import pdf
      class(pdf), intent(in) :: this
      integer getdims
    end function getdims

    pure function getx(this)
      import pdf
      class(pdf), intent(in) :: this
      real, dimension(this%getdims()) :: getx
    end function getx
  end interface

end module pdfs



gives me (four times!):

      real, dimension(this%getdims()) :: getx
                      1
Error: Function 'this' at (1) must be PURE


which is of course bogus, since 'this' is not even a function, and getdims is
actually pure.



More information about the Gcc-bugs mailing list