view gcc/testsuite/gfortran.dg/analyzer/pr93993.f90 @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
line wrap: on
line source

module np
  implicit none
  integer, parameter :: za = selected_real_kind(15, 307)
end module np

module gg
  use np

  type et(real_kind)
    integer, kind :: real_kind
  end type et

contains

  function hv (tm) result(ce)
    type (et(real_kind=za)), allocatable, target :: tm
    type (et(real_kind=za)), pointer :: ce

    allocate (tm) ! { dg-bogus "dereference of possibly-NULL" }
    ce => tm
  end function hv

end module gg

program a5
  use np
  use gg
  implicit none
  type (et(real_kind=za)), allocatable :: qb
  type (et(real_kind=za)), pointer :: vt

  vt => hv (qb)
end program a5 ! { dg-warning "leak of '.*qb'" }