aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/select_type_11.f03
blob: c3bd9bac8d5346bff93dd673307c065d3117c861 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
! { dg-do compile }
!
! PR 42335: [OOP] ICE on CLASS IS (bad_identifier)
!
! Contributed by Harald Anlauf <anlauf@gmx.de>

  implicit none
  type, abstract :: vector_class
  end type vector_class

  type, extends(vector_class) :: trivial_vector_type
    real :: elements(100)
  end type trivial_vector_type

contains

  subroutine bar (this,v)
    class(trivial_vector_type), intent(inout) :: this
    class(vector_class),        intent(in)    :: v

    select type (v)
    class is (bad_id)                    ! { dg-error " error in CLASS IS specification" }
       this%elements(:) = v%elements(:)  ! { dg-error "is not a member of" }
    end select

  end subroutine bar

end