]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/fortran/primary.c
re PR fortran/59502 ([OOP] ICE on invalid on pointer assignment to non-pointer CLASS)
[thirdparty/gcc.git] / gcc / fortran / primary.c
index c9a26b09be416071b9e0eae95bf8b7e557a10602..089ed429310c1bbcfe2c9966a081e7c561a5f6d8 100644 (file)
@@ -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;