This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/47194] New: [OOP] EXTENDS_TYPE_OF still returns the wrong result if the polymorphic variable is unallocated
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 6 Jan 2011 17:33:37 +0000
- Subject: [Bug fortran/47194] New: [OOP] EXTENDS_TYPE_OF still returns the wrong result if the polymorphic variable is unallocated
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47194
Summary: [OOP] EXTENDS_TYPE_OF still returns the wrong result
if the polymorphic variable is unallocated
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
Found when looking at PR 41580 -- and related to PR47180, PR47024 and PR47189.
The following programs works if "b1" was never allocated - and if it was last
allocated to "t1"; it fails if it was last allocated to "t11".
Thus, the vtab seems to be properly set initially; it also seems to be properly
set during allocation, but it does not seem to get reset for DEALLOCATE.
implicit none
type t1
integer :: a
end type t1
type, extends(t1):: t11
integer :: b
end type t11
class(t1), allocatable :: b1
class(t11), allocatable :: b11
allocate(t11 :: b1)
deallocate(b1)
if (extends_type_of(b1,b11) .neqv. .false.) call abort()
end