+2019-12-10 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/92863
+ * misc.c (gfc_typename): If derived component is NULL for
+ derived or class, return "invalid type" or "invalid class",
+ respectively.
+
2019-12-10 Tobias Burnus <tobias@codesourcery.com>
PR fortran/92872
sprintf (buffer, "UNION(%s)", ts->u.derived->name);
break;
case BT_DERIVED:
+ if (ts->u.derived == NULL)
+ {
+ sprintf (buffer, "invalid type");
+ break;
+ }
sprintf (buffer, "TYPE(%s)", ts->u.derived->name);
break;
case BT_CLASS:
+ if (ts->u.derived == NULL)
+ {
+ sprintf (buffer, "invalid class");
+ break;
+ }
ts1 = ts->u.derived->components ? &ts->u.derived->components->ts : NULL;
if (ts1 && ts1->u.derived && ts1->u.derived->attr.unlimited_polymorphic)
sprintf (buffer, "CLASS(*)");
+2019-12-10 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/92863
+ * gfortran.dg/interface_45.f90: New test.
+
2019-12-10 Richard Sandiford <richard.sandiford@arm.com>
* gcc.target/aarch64/sve/mixed_size_7.c: New test.
--- /dev/null
+! { dg-do compile }
+! PR 92863 - this used to ICE
+! Test case by Arseny Solokha.
+
+type(l1) function mp() ! { dg-error "type for function" }
+ call sub(mp) ! { dg-error "Type mismatch" }
+end function mp
+
+function bi(ry)
+ call sub(ry) ! { dg-error "Type mismatch" }
+end function bi