+2020-04-06 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/93686
+ * decl.c (gfc_match_data): Handle data matching for derived type
+ pointers.
+
2020-04-02 Tobias Burnus <tobias@codesourcery.com>
* gfortran.h (gfc_resolve_formal_arglist): Add prototype.
/* 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
+2020-04-06 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/93686
+ * gfortran.dg/pr93686_1.f90: New test.
+ * gfortran.dg/pr93686_2.f90: Likewise.
+ * gfortran.dg/pr93686_3.f90: Likewise.
+ * gfortran.dg/pr93686_4.f90: Likewise.
+
2020-04-06 Joel Brobecker <brobecker@adacore.com>
* gcc.target/arm/div64-unwinding.c: Skip on vxworks_kernel targets.
--- /dev/null
+! { dg-do compile }
+! PR fortran/93686
+
+program p
+ type t
+ integer :: a
+ end type
+ type(t), pointer :: x
+ data x /t(2)/ ! { dg-error "part-ref with pointer attribute near ... is not rightmost part-ref of data-stmt-object" }
+end
--- /dev/null
+! { dg-do compile }
+! PR fortran/93686
+
+program p
+ type t
+ integer :: a = 1
+ end type
+ type(t), pointer :: x
+ data x /t(2)/ ! { dg-error "part-ref with pointer attribute near ... is not rightmost part-ref of data-stmt-object" }
+end
--- /dev/null
+! { dg-do compile }
+! PR fortran/93686
+
+program p
+ type t
+ end type
+ type(t), pointer :: x
+ data x /t()/ ! { dg-error "part-ref with pointer attribute near ... is not rightmost part-ref of data-stmt-object" }
+end
--- /dev/null
+! { dg-do compile }
+! PR fortran/93686
+
+type t
+end type
+type(t), pointer :: x
+data x / ! { dg-error "part-ref with pointer attribute near ... is not rightmost part-ref of data-stmt-object" }
+end