diff options
author | Janus Weil <janus@gcc.gnu.org> | 2011-02-12 22:34:11 +0100 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2011-02-12 22:34:11 +0100 |
commit | 96d9b22c0ba19a2177fe7d254cb3a7e5fa49463f (patch) | |
tree | 1f3c46a16af849afee31b6d349f3b132ad36634f /gcc/fortran | |
parent | a016dc83ecbbcd3deb7b23b6b8dad86475c1a831 (diff) | |
download | gcc-96d9b22c0ba19a2177fe7d254cb3a7e5fa49463f.zip gcc-96d9b22c0ba19a2177fe7d254cb3a7e5fa49463f.tar.gz gcc-96d9b22c0ba19a2177fe7d254cb3a7e5fa49463f.tar.bz2 |
class.c (gfc_build_class_symbol): Reject polymorphic arrays.
2011-02-12 Janus Weil <janus@gcc.gnu.org>
* 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 <janus@gcc.gnu.org>
* 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
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/class.c | 6 | ||||
-rw-r--r-- | gcc/fortran/decl.c | 13 |
3 files changed, 20 insertions, 5 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 7749cad..e3b545f 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2011-02-12 Janus Weil <janus@gcc.gnu.org> + + * 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 Michael Matz <matz@suse.de> Janus Weil <janus@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c index 2227f9e..7c8babe 100644 --- a/gcc/fortran/class.c +++ b/gcc/fortran/class.c @@ -184,6 +184,12 @@ gfc_build_class_symbol (gfc_typespec *ts, symbol_attribute *attr, gfc_symbol *vtab; gfc_component *c; + if (*as) + { + gfc_error ("Polymorphic array at %C not yet supported"); + return FAILURE; + } + /* Determine the name of the encapsulating type. */ get_unique_hashed_string (tname, ts->u.derived); if ((*as) && (*as)->rank && attr->allocatable) diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 638a7386..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) { |