This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/48351] [OOP] Realloc on assignment fails if parent component is CLASS
- 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: Wed, 30 Mar 2011 08:04:24 +0000
- Subject: [Bug fortran/48351] [OOP] Realloc on assignment fails if parent component is CLASS
- Auto-submitted: auto-generated
- References: <bug-48351-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48351
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-03-30 08:04:13 UTC ---
trans-array.c's gfc_is_reallocatable_lhs fails at:
6859 /* All that can be left are allocatable components. */
6860 if ((expr->symtree->n.sym->ts.type != BT_DERIVED
6861 && expr->symtree->n.sym->ts.type != BT_CLASS)
6862 || !expr->symtree->n.sym->ts.u.derived->attr.alloc_comp)
6863 return false;
The reason is that the CLASS wrapper does not set:
(gdb) p expr->symtree->n.sym->ts.u.derived->attr.alloc_comp
$3 = 0
Only the "_data" component has this value set for its type:
(gdb) p expr->symtree->n.sym->ts.u.derived->components->ts.u.derived->name
$12 = 0x2aaaaab42f98 "foo_t"
(gdb) p
expr->symtree->n.sym->ts.u.derived->components->ts.u.derived->attr.alloc_comp
$13 = 1