Hi all,
here is a close-to-trivial patch for an ICE-on-invalid problem. It
regtests cleanly.
Ok for trunk? (If there are no objections, I'd like to commit this in
the coming days.)
Cheers,
Janus
2017-11-11 Janus Weil <[email protected]>
PR fortran/82932
* resolve.c (update_compcall_arglist): Improve error recovery,
remove a gcc_assert.
2017-11-11 Janus Weil <[email protected]>
PR fortran/82932
* gfortran.dg/typebound_call_29.f90: New test.
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c (revision 253982)
+++ gcc/fortran/resolve.c (working copy)
@@ -5834,7 +5834,9 @@ update_compcall_arglist (gfc_expr* e)
return true;
}
- gcc_assert (tbp->pass_arg_num > 0);
+ if (tbp->pass_arg_num <= 0)
+ return false;
+
e->value.compcall.actual = update_arglist_pass (e->value.compcall.actual, po,
tbp->pass_arg_num,
tbp->pass_arg);
! { dg-do compile }
!
! PR 82932: [OOP] ICE in update_compcall_arglist, at fortran/resolve.c:5837
!
! Contributed by Janus Weil <[email protected]>
module m
implicit none
type, abstract :: AT
contains
procedure(init_ifc), deferred :: sinit
procedure(missing_ifc), deferred :: missing
generic :: init => sinit
end type
abstract interface
subroutine init_ifc(data)
import AT
class(AT) :: data
end subroutine
subroutine missing_ifc(data)
import AT
class(AT) :: data
end subroutine
end interface
end module
program p
use m
implicit none
type, extends(AT) :: ET ! { dg-error "must be ABSTRACT" }
contains
procedure :: sinit
end type
type(ET) :: c
call c%init()
end