This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch, Fortran, F03] PR 58023: ICE on invalid with bad PPC declaration


Hi all,

the attached patch fixes an ICE-on-invalid problem with
procedure-pointer components by making sure that we continue resolving
all components of a derived type, even after an error is thrown.

Regtested on x86_64-unknown-linux-gnu. Ok for trunk?

Cheers,
Janus



2015-01-13  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/58023
    * resolve.c (resolve_fl_derived0): Continue resolving next component
    after error.

2015-01-13  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/58023
    * gfortran.dg/proc_ptr_comp_43.f90: New.

Attachment: pr58023.diff
Description: Text document

! { dg-do compile }
!
! PR 58023: [F03] ICE on invalid with bad PPC declaration
!
! Contributed by Andrew Benson <abensonca@gmail.com>

module m
  implicit none

  abstract interface
     double precision function mr()
     end function mr
  end interface

  type :: sfd
     procedure(mr), pointer :: mr1  ! { dg-error "must have at least one argument" }
     procedure(mr), pointer :: mr2  ! { dg-error "must have at least one argument" }
  end type sfd

contains

  subroutine go()
    implicit none
    type(sfd):: d

    write (0,*) d%mr2()
    return
  end subroutine go

end module m

! { dg-final { cleanup-modules "m" } }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]