aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r--gcc/fortran/expr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 4c76f53..f54affa 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -1080,8 +1080,10 @@ is_subref_array (gfc_expr * e)
for (ref = e->ref; ref; ref = ref->next)
{
/* If we haven't seen the array reference and this is an intrinsic,
- what follows cannot be a subreference array. */
+ what follows cannot be a subreference array, unless there is a
+ substring reference. */
if (!seen_array && ref->type == REF_COMPONENT
+ && ref->u.c.component->ts.type != BT_CHARACTER
&& ref->u.c.component->ts.type != BT_CLASS
&& !gfc_bt_struct (ref->u.c.component->ts.type))
return false;