+2018-02-07 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/82994
+ * match.c (gfc_match_deallocate): Check for NULL pointer.
+
2018-02-07 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/68560
&& (tail->expr->ref->type == REF_COMPONENT
|| tail->expr->ref->type == REF_ARRAY));
if (sym && sym->ts.type == BT_CLASS)
- b2 = !(CLASS_DATA (sym)->attr.allocatable
- || CLASS_DATA (sym)->attr.class_pointer);
+ b2 = !(CLASS_DATA (sym) && (CLASS_DATA (sym)->attr.allocatable
+ || CLASS_DATA (sym)->attr.class_pointer));
else
b2 = sym && !(sym->attr.allocatable || sym->attr.pointer
|| sym->attr.proc_pointer);
+2018-02-07 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/82994
+ * gfortran.dg/deallocate_error_3.f90: New test.
+ * gfortran.dg/deallocate_error_4.f90: New test.
+
2018-02-07 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/68560
--- /dev/null
+! { dg-do compile }
+! PR fortran/82994
+! Code contributed by Gerhard Steinmetz
+program p
+ type t
+ end type
+ class(t) :: x ! { dg-error "must be dummy, allocatable or pointer" }
+ deallocate (x) ! { dg-error "not a nonprocedure pointer nor an allocatable" }
+end
--- /dev/null
+! { dg-do compile }
+! PR fortran/82994
+! Code contributed by Gerhard Steinmetz
+program p
+ type t
+ end type
+ class(t) :: x ! { dg-error "must be dummy, allocatable or pointer" }
+ allocate (x) ! { dg-error "neither a data pointer nor an allocatable" }
+ deallocate (x) ! { dg-error "not a nonprocedure pointer nor an allocatable" }
+end