aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r--gcc/fortran/decl.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 9712ea2..8b5f92b 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -1177,9 +1177,7 @@ build_sym (const char *name, gfc_charlen *cl, bool cl_deferred,
sym->attr.implied_index = 0;
- if (sym->ts.type == BT_CLASS
- && (sym->attr.class_ok = sym->attr.dummy || sym->attr.pointer
- || sym->attr.allocatable))
+ if (sym->ts.type == BT_CLASS)
return gfc_build_class_symbol (&sym->ts, &sym->attr, &sym->as, false);
return SUCCESS;
@@ -2613,6 +2611,16 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag)
ts->type = BT_DERIVED;
else
{
+ /* Match CLASS declarations. */
+ m = gfc_match (" class ( * )");
+ if (m == MATCH_ERROR)
+ return MATCH_ERROR;
+ else if (m == MATCH_YES)
+ {
+ gfc_fatal_error ("Unlimited polymorphism at %C not yet supported");
+ return MATCH_ERROR;
+ }
+
m = gfc_match (" class ( %n )", name);
if (m != MATCH_YES)
return m;
@@ -6045,9 +6053,7 @@ 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)
+ if (sym->ts.type == BT_CLASS
&& gfc_build_class_symbol (&sym->ts, &sym->attr, &sym->as, false) == FAILURE)
{
m = MATCH_ERROR;