The error recovery after an invalid reference to an undefined CLASS
during a TYPE declaration lead to an invalid access. Add a check.
gcc/fortran/ChangeLog:
* resolve.c (resolve_component): Add check for valid CLASS
reference before trying to access CLASS data.
(cherry picked from commit
8b6f1e8f97fe0d435d334075821149dbd85c8266)
/* F2008, C448. */
if (c->ts.type == BT_CLASS)
{
- if (CLASS_DATA (c))
+ if (c->attr.class_ok && CLASS_DATA (c))
{
attr = &(CLASS_DATA (c)->attr);