view gcc/testsuite/gfortran.dg/allocate_class_2.f90 @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

! { dg-do compile }
!
! PR 52552: [OOP] ICE when trying to allocate non-allocatable object giving a dynamic type
!
! Contributed by <gccbgz.lionm@xoxy.net>


  type t
    integer :: i
  end type
  
  class(t) :: o      ! { dg-error "must be dummy, allocatable or pointer" }

  allocate(t::o)     ! { dg-error "is neither a data pointer nor an allocatable variable" }

end