diff options
Diffstat (limited to 'gcc/fortran/primary.c')
-rw-r--r-- | gcc/fortran/primary.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index 75c7e137..afc4684 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -1821,7 +1821,8 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag, && !(gfc_matching_procptr_assignment && sym->attr.flavor == FL_PROCEDURE)) || (sym->ts.type == BT_CLASS && sym->attr.class_ok - && CLASS_DATA (sym)->attr.dimension)) + && (CLASS_DATA (sym)->attr.dimension + || CLASS_DATA (sym)->attr.codimension))) { /* In EQUIVALENCE, we don't know yet whether we are seeing an array, character variable or array of character @@ -2894,10 +2895,10 @@ gfc_match_rvalue (gfc_expr **result) && gfc_get_default_type (sym->name, sym->ns)->type == BT_DERIVED) gfc_set_default_type (sym, 0, sym->ns); - /* If the symbol has a dimension attribute, the expression is a + /* If the symbol has a (co)dimension attribute, the expression is a variable. */ - if (sym->attr.dimension) + if (sym->attr.dimension || sym->attr.codimension) { if (gfc_add_flavor (&sym->attr, FL_VARIABLE, sym->name, NULL) == FAILURE) @@ -2913,7 +2914,9 @@ gfc_match_rvalue (gfc_expr **result) break; } - if (sym->ts.type == BT_CLASS && CLASS_DATA (sym)->attr.dimension) + if (sym->ts.type == BT_CLASS + && (CLASS_DATA (sym)->attr.dimension + || CLASS_DATA (sym)->attr.codimension)) { if (gfc_add_flavor (&sym->attr, FL_VARIABLE, sym->name, NULL) == FAILURE) |