[Bug fortran/46897] New: [OOP] Polymorphic type - defined ASSIGNMENT(=) not used
burnus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Dec 11 22:20:00 GMT 2010
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46897
Summary: [OOP] Polymorphic type - defined ASSIGNMENT(=) not
used
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: burnus@gcc.gnu.org
CC: janus@gcc.gnu.org
Reported by Damian at http://gcc.gnu.org/ml/fortran/2010-12/msg00063.html
The following program should print "defined assignment called". It does so with
the IBM compiler but not with gfortran.
module component_parent_child_module
implicit none
type component
contains
procedure :: assign
generic :: assignment(=)=>assign
end type
type parent
type(component) :: foo
end type
type, extends(parent) :: child
end type
contains
subroutine assign(lhs,rhs)
class(component), intent(out) :: lhs
class(component), intent(in) :: rhs
print *,'defined assignment called'
end subroutine
type(child) function new_child()
end function
end module
program main
use component_parent_child_module
implicit none
type(child) :: infant
infant = new_child()
end
More information about the Gcc-bugs
mailing list