summaryrefslogtreecommitdiff
path: root/gcc/fortran/primary.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/primary.c')
-rw-r--r--gcc/fortran/primary.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c
index c9a26b09be4..089ed429310 100644
--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -2039,9 +2039,8 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag,
if (m != MATCH_YES)
return m;
}
- else if (component->ts.type == BT_CLASS
- && CLASS_DATA (component)->as != NULL
- && !component->attr.proc_pointer)
+ else if (component->ts.type == BT_CLASS && component->attr.class_ok
+ && CLASS_DATA (component)->as && !component->attr.proc_pointer)
{
tail = extend_ref (primary, tail);
tail->type = REF_ARRAY;