view gcc/testsuite/gfortran.dg/class_69.f90 @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
line wrap: on
line source

! { dg-do compile }
!
! PR 88047: [9 Regression] ICE in gfc_find_vtab, at fortran/class.c:2843
!
! Contributed by G. Steinmetz <gscfq@t-online.de>

subroutine sub_a
   type t
   end type
   class(t) :: x(2)                   ! { dg-error "must be dummy, allocatable or pointer" }
   class(t), parameter :: a(2) = t()  ! { dg-error "cannot have the PARAMETER attribute" }
   x = a                              ! { dg-error "Nonallocatable variable must not be polymorphic in intrinsic assignment" }
end

subroutine sub_b
   type t
      integer :: n
   end type
   class(t) :: a, x                   ! { dg-error "must be dummy, allocatable or pointer" }
   x = a                              ! { dg-error "Nonallocatable variable must not be polymorphic in intrinsic assignment" }
end