+2015-03-16 Andre Vehreschild <vehre@gmx.de>
+
+ * resolve.c: Prevent segfault on illegal input.
+
2015-03-14 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/61138
expr->ts = sym->ts;
expr->value.function.name = sym->name;
expr->value.function.esym = sym;
+ /* Prevent crash when sym->ts.u.derived->components is not set due to previous
+ error(s). */
+ if (sym->ts.type == BT_CLASS && !CLASS_DATA (sym))
+ return MATCH_ERROR;
if (sym->ts.type == BT_CLASS && CLASS_DATA (sym)->as)
expr->rank = CLASS_DATA (sym)->as->rank;
else if (sym->as != NULL)
+2015-03-16 Andre Vehreschild <vehre@gmx.de>
+
+ * gfortran.dg/pointer_2.f90: New test.
+
2015-03-16 Eric Botcazou <ebotcazou@adacore.com>
* testsuite/g++.dg/pr65049.C: New test.
--- /dev/null
+! { dg-do compile }
+! Check that the compiler reports the errors, but does not segfault.
+! Contributed by: Andre Vehreschild <vehre@gcc.gnu.org>
+!
+program test
+ implicit none
+ class(*), pointer :: P
+ class(*), allocatable :: P2
+
+ allocate(P2, source=convertType(P))
+
+contains
+
+ function convertType(in) ! { dg-error "must be dummy, allocatable or pointer" }
+ class(*), intent(in) :: in
+ class(*) :: convertType
+ end function
+end program test