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, OOP] PR 80766: [7/8 Regression] ICE with type-bound procedure returning an array


Hi all,

the attached patch fixes an ICE-on-valid regression by making sure
that the relevant vtype symbol is resolved properly (for further
discussion see the PR).

The patch regtests cleanly on x86_64-linux-gnu. Ok for trunk and 7-branch?

Cheers,
Janus


2017-05-21  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/80766
    * resolve.c (resolve_fl_derived): Make sure that vtype symbols are
    properly resolved.

2017-05-21  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/80766
    * gfortran.dg/typebound_call_28.f90: New test.

Attachment: pr80766_v3.diff
Description: Text document

! { dg-do compile }
!
! PR 80766: [7/8 Regression] [OOP] ICE with type-bound procedure returning an array
!
! Contributed by Vladimir Fuka <vladimir.fuka@gmail.com>

module m1

  type :: base
  contains
     procedure :: fun
  end type

  type, extends(base) :: child
  end type

contains

  function fun(o) result(res)
    real :: res(3)
    class(base) :: o
    res = 0
  end function
end module


module m2
contains

  subroutine sub(o)
    use m1
    class(child) :: o
    real :: res(3)

    res = o%fun()
  end subroutine
end module

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