! { dg-do-run }
!
! Contributed by Gerhard Steinmetz  <gscfq@t-online.de>
!
program p
   type t
   end type
   type, extends(t) :: t2
   end type
   class(t), allocatable :: x
   associate (y => (x))  ! The parentheses triggered an ICE in select type
      select type (y)
      type is (t2)
          print *, "is T2"
          stop 1
      type is (t)
          print *, "is T"
      class default
          stop 2
      end select
   end associate
end
