1! { dg-do compile }
2!
3! PR 71894: [OOP] ICE in gfc_add_component_ref, at fortran/class.c:227
4!
5! Contributed by Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de>
6
7subroutine s1
8  type t
9    integer :: n
10  end type
11  type(t) :: x
12  class(t) :: y  ! { dg-error "must be dummy, allocatable or pointer" }
13  x = y
14end
15
16subroutine s2
17  type t
18  end type
19  class(t) :: x    ! { dg-error "must be dummy, allocatable or pointer" }
20  class(t), allocatable :: y
21  select type (y)
22  type is (t)
23    y = x
24  end select
25end
26