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/48095] [OOP] Invalid assignment to procedure pointer component not rejected


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

--- Comment #3 from janus at gcc dot gnu.org 2011-03-28 20:55:13 UTC ---
Also the following variant is not rejected (seems to be a module problem):


module m

  implicit none

  type :: rectangle
    real :: width, height
    procedure(get_area), pointer, pass(this) :: get_special_area
  end type rectangle

  abstract interface
    real function get_area( this )
      import                       :: rectangle
      class(rectangle), intent(in) :: this
    end function get_area
  end interface

  type(rectangle) :: rect

contains

  real function get_my_area( this )
    type(rectangle), intent(in) :: this
    write(*,*) 'This: ', this%width, this%height
    get_my_area = 3.0 * this%width * this%height
  end function get_my_area

end module


use m
rect%get_special_area => get_my_area  
end


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