From 22061030a7395524b390bf0cc7382802586cfd53 Mon Sep 17 00:00:00 2001 From: Janus Weil Date: Thu, 30 Dec 2010 12:53:35 +0100 Subject: re PR fortran/47085 ([OOP] Problem in allocate( SOURCE=) for polymorphic component) 2010-12-30 Janus Weil PR fortran/47085 * match.c (gfc_match_allocate): Check for 'class_ok'. * primary.c (gfc_match_varspec): Ditto. 2010-12-30 Janus Weil PR fortran/47085 * gfortran.dg/allocate_class_1.f90: New. From-SVN: r168340 --- gcc/fortran/match.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/fortran/match.c') diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index 44da1bb..a74fdb7 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -2956,7 +2956,7 @@ gfc_match_allocate (void) b1 = !(tail->expr->ref && (tail->expr->ref->type == REF_COMPONENT || tail->expr->ref->type == REF_ARRAY)); - if (sym && sym->ts.type == BT_CLASS) + if (sym && sym->ts.type == BT_CLASS && sym->attr.class_ok) b2 = !(CLASS_DATA (sym)->attr.allocatable || CLASS_DATA (sym)->attr.class_pointer); else -- cgit v1.1