+2019-12-21 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/92990
+ * match.c (gfc_match_nullify): Check for valid pointer object.
+ Reject bounds remapping.
+
2019-12-21 Paul Thomas <pault@gcc.gnu.org>
PR fortran/92753
goto cleanup;
}
+ /* Check for valid array pointer object. Bounds remapping is not
+ allowed with NULLIFY. */
+ if (p->ref)
+ {
+ gfc_ref *remap = p->ref;
+ for (; remap; remap = remap->next)
+ if (!remap->next && remap->type == REF_ARRAY
+ && remap->u.ar.type != AR_FULL)
+ break;
+ if (remap)
+ {
+ gfc_error ("NULLIFY does not allow bounds remapping for "
+ "pointer object at %C");
+ goto cleanup;
+ }
+ }
+
/* build ' => NULL() '. */
e = gfc_get_null_expr (&gfc_current_locus);
+2019-12-21 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/92990
+ * gfortran.dg/pr92990.f90: New test.
+
2019-12-21 Paul Thomas <pault@gcc.gnu.org>
PR fortran/92753
--- /dev/null
+! { dg-do compile }
+! PR fortran/92990
+! Verify fix of error message for NULLIFY vs. pointer assignment (PR70853)
+program p
+ integer, pointer :: x(:)
+ type t
+ integer, pointer :: y(:)
+ end type t
+ type(t) :: z
+ nullify (x(1:2)) ! { dg-error "does not allow bounds remapping" }
+ nullify (z%y(:)) ! { dg-error "does not allow bounds remapping" }
+end