From d6430d9a0c02cac4655cedd1e489ad1ea08dffb2 Mon Sep 17 00:00:00 2001 From: Paul Thomas Date: Fri, 13 Jan 2012 20:42:01 +0000 Subject: re PR fortran/48351 ([OOP] Realloc on assignment fails if parent component is CLASS) 2012-01-13 Paul Thomas PR fortran/48351 * trans-array.c (structure_alloc_comps): Suppress interative call to self, when current component is deallocated using gfc_trans_dealloc_allocated. * class.c (gfc_build_class_symbol): Copy the 'alloc_comp' attribute from the declared type to the class structure. 2012-01-13 Paul Thomas PR fortran/48351 * gfortran.dg/alloc_comp_assign.f03: New. * gfortran.dg/allocatable_scalar_9.f90: Reduce count of __BUILTIN_FREE from 38 to 32. From-SVN: r183162 --- gcc/fortran/class.c | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/fortran/class.c') diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c index 37c653a..a17fc0a 100644 --- a/gcc/fortran/class.c +++ b/gcc/fortran/class.c @@ -432,6 +432,7 @@ gfc_build_class_symbol (gfc_typespec *ts, symbol_attribute *attr, } fclass->attr.extension = ts->u.derived->attr.extension + 1; + fclass->attr.alloc_comp = ts->u.derived->attr.alloc_comp; fclass->attr.is_class = 1; ts->u.derived = fclass; attr->allocatable = attr->pointer = attr->dimension = attr->codimension = 0; -- cgit v1.1