From d0a9804e353b33d339e20f0aa2bd458a4ff08649 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Fri, 9 Oct 2009 22:34:35 +0200 Subject: re PR fortran/41582 ([OOP] Allocation of abstract types requires a type spec or a SOURCE) 2009-10-09 Tobias Burnus PR fortran/41582 * decl.c (encapsulate_class_symbol): Save attr.abstract. * resolve.c (resolve_allocate_expr): Reject class allocate without typespec or source=. * trans-stmt.c (gfc_trans_allocate): Change gfc_warning into gfc_error for "not yet implemented". 2009-10-09 Tobias Burnus PR fortran/41582 * gfortran.dg/class_allocate_1.f03: Modify code such that it compiles with the gfc_warning->gfc_error change. * gfortran.dg/class_allocate_1.f03: New test. From-SVN: r152601 --- gcc/fortran/decl.c | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/fortran/decl.c') diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 82442042..2c378fb 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -1077,6 +1077,7 @@ encapsulate_class_symbol (gfc_typespec *ts, symbol_attribute *attr, c->attr.pointer = attr->pointer || attr->dummy; c->attr.allocatable = attr->allocatable; c->attr.dimension = attr->dimension; + c->attr.abstract = ts->u.derived->attr.abstract; c->as = (*as); c->initializer = gfc_get_expr (); c->initializer->expr_type = EXPR_NULL; -- cgit v1.1