aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/class_69.f90
blob: e45e03528b7011627af204faa0c73467fa394a9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
! { 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