This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/46313] [OOP] class container naming collisions
- 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: Fri, 7 Jan 2011 13:26:18 +0000
- Subject: [Bug fortran/46313] [OOP] class container naming collisions
- Auto-submitted: auto-generated
- References: <bug-46313-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46313
--- Comment #21 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-01-07 13:25:56 UTC ---
(In reply to comment #19)
> (In reply to comment #18)
> class(two_three), allocatable :: a1
> class(three), allocatable :: a2
> In the dump you can see that we end up with one vtab for both types.
The simplest run-time test is to add:
print *, same_type_as(a1,a2)
which should always be .FALSE. but is currently .TRUE.
Actually, also something else is odd: One finds in the dump a
D.1555 = a1._vptr->_hash == a2._vptr->_hash;
even with the patch for PR 41580. However, the check in
gfc_simplify_same_type_as which tests:
+ if ((a->ts.type == BT_CLASS || b->ts.type == BT_CLASS)
+ && !gfc_type_compatible (&a->ts, &b->ts)
+ && !gfc_type_compatible (&b->ts, &a->ts))
should have succeeded as the (declared) type of "a1" is not type compatible to
"a2" - nor vice versa.