diff options
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r-- | gcc/fortran/expr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index 129ece3..d136140 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -4648,7 +4648,8 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj, the component of sub-component of a pointer. Obviously, procedure pointers are of no interest here. */ check_intentin = true; - ptr_component = sym->attr.pointer; + ptr_component = (sym->ts.type == BT_CLASS && CLASS_DATA (sym)) + ? CLASS_DATA (sym)->attr.class_pointer : sym->attr.pointer; for (ref = e->ref; ref && check_intentin; ref = ref->next) { if (ptr_component && ref->type == REF_COMPONENT) |