This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/48095] [OOP] Invalid assignment to procedure pointer component not rejected
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 28 Mar 2011 20:55:15 +0000
- Subject: [Bug fortran/48095] [OOP] Invalid assignment to procedure pointer component not rejected
- Auto-submitted: auto-generated
- References: <bug-48095-4@http.gcc.gnu.org/bugzilla/>
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