re PR fortran/92863 (ICE in gfc_typename)
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 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/92863 * gfortran.dg/interface_45.f90: New test. From-SVN: r279180
This commit is contained in:
parent
940317b75c
commit
f812dfe8e0
@ -1,3 +1,10 @@
|
|||||||
|
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>
|
2019-12-10 Tobias Burnus <tobias@codesourcery.com>
|
||||||
|
|
||||||
PR fortran/92872
|
PR fortran/92872
|
||||||
|
@ -164,9 +164,19 @@ gfc_typename (gfc_typespec *ts)
|
|||||||
sprintf (buffer, "UNION(%s)", ts->u.derived->name);
|
sprintf (buffer, "UNION(%s)", ts->u.derived->name);
|
||||||
break;
|
break;
|
||||||
case BT_DERIVED:
|
case BT_DERIVED:
|
||||||
|
if (ts->u.derived == NULL)
|
||||||
|
{
|
||||||
|
sprintf (buffer, "invalid type");
|
||||||
|
break;
|
||||||
|
}
|
||||||
sprintf (buffer, "TYPE(%s)", ts->u.derived->name);
|
sprintf (buffer, "TYPE(%s)", ts->u.derived->name);
|
||||||
break;
|
break;
|
||||||
case BT_CLASS:
|
case BT_CLASS:
|
||||||
|
if (ts->u.derived == NULL)
|
||||||
|
{
|
||||||
|
sprintf (buffer, "invalid class");
|
||||||
|
break;
|
||||||
|
}
|
||||||
ts1 = ts->u.derived->components ? &ts->u.derived->components->ts : NULL;
|
ts1 = ts->u.derived->components ? &ts->u.derived->components->ts : NULL;
|
||||||
if (ts1 && ts1->u.derived && ts1->u.derived->attr.unlimited_polymorphic)
|
if (ts1 && ts1->u.derived && ts1->u.derived->attr.unlimited_polymorphic)
|
||||||
sprintf (buffer, "CLASS(*)");
|
sprintf (buffer, "CLASS(*)");
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
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>
|
2019-12-10 Richard Sandiford <richard.sandiford@arm.com>
|
||||||
|
|
||||||
* gcc.target/aarch64/sve/mixed_size_7.c: New test.
|
* gcc.target/aarch64/sve/mixed_size_7.c: New test.
|
||||||
|
11
gcc/testsuite/gfortran.dg/interface_45.f90
Normal file
11
gcc/testsuite/gfortran.dg/interface_45.f90
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
! { 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
|
Loading…
Reference in New Issue
Block a user