[Bug fortran/66089] [7/8/9 Regression] elemental dependency mishandling when derived types are involved

tkoenig at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Feb 5 20:22:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66089

--- Comment #29 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
This also fails:

  type :: t
    integer :: c
  end type t

  class(t), dimension(:), allocatable :: a, b
  class(t), dimension(:), allocatable :: c

  allocate (a(5), source=t(1))
  allocate (b(5), source=t(7))
  allocate(c(5), source=t(13))
  c = plus(c(1), b)
  print *, c%c
  if (any(c%c /= 20)) call abort

contains

  elemental function plus(lhs, rhs)
    class(t), intent(in) :: lhs, rhs
    type(t)             :: plus
    plus%c = lhs%c + rhs%c
  end function plus

end


More information about the Gcc-bugs mailing list