diff options
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r-- | gcc/fortran/decl.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 12dcf84..9786a860 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -5755,19 +5755,16 @@ attr_decl1 (void) /* Update symbol table. DIMENSION attribute is set in gfc_set_array_spec(). For CLASS variables, this must be applied to the first component, or '$data' field. */ - if (sym->ts.type == BT_CLASS && sym->ts.u.derived) + if (sym->ts.type == BT_CLASS) { - gfc_component *comp; - comp = gfc_find_component (sym->ts.u.derived, "$data", true, true); - if (comp == NULL || gfc_copy_attr (&comp->attr, ¤t_attr, - &var_locus) == FAILURE) + if (gfc_copy_attr (&CLASS_DATA (sym)->attr, ¤t_attr,&var_locus) + == FAILURE) { m = MATCH_ERROR; goto cleanup; } - sym->attr.class_ok = (sym->attr.class_ok - || current_attr.allocatable - || current_attr.pointer); + sym->attr.class_ok = (sym->attr.class_ok || current_attr.allocatable + || current_attr.pointer); } else { |