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/46897] [OOP] Polymorphic type - defined ASSIGNMENT(=) not used


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

--- Comment #1 from janus at gcc dot gnu.org 2010-12-12 22:15:30 UTC ---
Here is a slightly reduced test case:


module m
  implicit none

  type component
  contains
    procedure :: assign
    generic :: assignment(=)=>assign
  end type

  type t
    type(component) :: foo
  end type

contains

  subroutine assign(lhs,rhs)
    class(component), intent(out) :: lhs
    class(component), intent(in) :: rhs
    print *,'defined assignment called'
  end subroutine

end module 

program main
  use m
  implicit none
  type(t) :: infant, newchild
  infant = newchild
end


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