2016-07-22 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/71862
* class.c: Remove assert. Iterate over component only if non-null.
2016-07-22 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/71862
* gfortran.dg/pr71862.f90: New test.
From-SVN: r238774
+2016-07-26 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/71862
+ * class.c: Remove assert. Iterate over component only if non-null.
+
2016-07-22 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/71935
/* Avoid losing memory. */
gfc_free_ref_list (*tail);
c = gfc_find_component (derived, name, true, true, tail);
- gcc_assert (c);
- for (ref = *tail; ref->next; ref = ref->next)
- ;
- ref->next = next;
- if (!next)
- e->ts = c->ts;
+
+ if (c) {
+ for (ref = *tail; ref->next; ref = ref->next)
+ ;
+ ref->next = next;
+ if (!next)
+ e->ts = c->ts;
+ }
}
+2016-07-26 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/71862
+ * gfortran.dg/pr71862.f90: New test.
+
2016-07-26 Martin Sebor <msebor@redhat.com>
* gcc.dg/atomic/pr71675.c: Replace the unsupported c11 target
--- /dev/null
+! { dg-do compile }
+program p
+ type t
+ integer :: n = 0
+ integer, pointer :: q => null()
+ end type
+ type(t) :: x
+ print *, associated(x%q)
+ x = f()
+ print *, associated(x%q)
+contains
+ function f() result (z) ! { dg-error "must be dummy, allocatable or pointer" }
+ class(t) :: z
+ print *, associated(z%q)
+ end
+end