From 96d9b22c0ba19a2177fe7d254cb3a7e5fa49463f Mon Sep 17 00:00:00 2001 From: Janus Weil Date: Sat, 12 Feb 2011 22:34:11 +0100 Subject: class.c (gfc_build_class_symbol): Reject polymorphic arrays. 2011-02-12 Janus Weil * class.c (gfc_build_class_symbol): Reject polymorphic arrays. * decl.c (build_sym,build_struct,attr_decl1): Use return value of 'gfc_build_class_symbol'. 2011-02-12 Janus Weil * gfortran.dg/allocate_derived_1.f90: Modified as polymorphic arrays are temporarily disabled. * gfortran.dg/class_7.f03: Ditto. * gfortran.dg/coarray_14.f90: Ditto. * gfortran.dg/typebound_proc_13.f03: Ditto. From-SVN: r170092 --- gcc/fortran/decl.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'gcc/fortran/decl.c') diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 638a738..9712ea2 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -1180,7 +1180,7 @@ build_sym (const char *name, gfc_charlen *cl, bool cl_deferred, if (sym->ts.type == BT_CLASS && (sym->attr.class_ok = sym->attr.dummy || sym->attr.pointer || sym->attr.allocatable)) - gfc_build_class_symbol (&sym->ts, &sym->attr, &sym->as, false); + return gfc_build_class_symbol (&sym->ts, &sym->attr, &sym->as, false); return SUCCESS; } @@ -1639,10 +1639,9 @@ scalar: bool delayed = (gfc_state_stack->sym == c->ts.u.derived) || (!c->ts.u.derived->components && !c->ts.u.derived->attr.zero_comp); - gfc_build_class_symbol (&c->ts, &c->attr, &c->as, delayed); + return gfc_build_class_symbol (&c->ts, &c->attr, &c->as, delayed); } - return t; } @@ -6048,8 +6047,12 @@ attr_decl1 (void) if (sym->ts.type == BT_CLASS && !sym->attr.class_ok && (sym->attr.class_ok = sym->attr.class_ok || current_attr.allocatable - || current_attr.pointer)) - gfc_build_class_symbol (&sym->ts, &sym->attr, &sym->as, false); + || current_attr.pointer) + && gfc_build_class_symbol (&sym->ts, &sym->attr, &sym->as, false) == FAILURE) + { + m = MATCH_ERROR; + goto cleanup; + } if (gfc_set_array_spec (sym, as, &var_locus) == FAILURE) { -- cgit v1.1