aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r--gcc/fortran/decl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index ea30908..b3ed63c 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -696,6 +696,10 @@ gfc_match_data (void)
/* F2008:C567 (R536) A data-i-do-object or a variable that appears
as a data-stmt-object shall not be an object designator in which
a pointer appears other than as the entire rightmost part-ref. */
+ if (!e->ref && e->ts.type == BT_DERIVED
+ && e->symtree->n.sym->attr.pointer)
+ goto partref;
+
ref = e->ref;
if (e->symtree->n.sym->ts.type == BT_DERIVED
&& e->symtree->n.sym->attr.pointer