Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gfortran.dg / select_type_11.f03
blobc3bd9bac8d5346bff93dd673307c065d3117c861
1 ! { dg-do compile }
3 ! PR 42335: [OOP] ICE on CLASS IS (bad_identifier)
5 ! Contributed by Harald Anlauf <anlauf@gmx.de>
7   implicit none
8   type, abstract :: vector_class
9   end type vector_class
11   type, extends(vector_class) :: trivial_vector_type
12     real :: elements(100)
13   end type trivial_vector_type
15 contains
17   subroutine bar (this,v)
18     class(trivial_vector_type), intent(inout) :: this
19     class(vector_class),        intent(in)    :: v
21     select type (v)
22     class is (bad_id)                    ! { dg-error " error in CLASS IS specification" }
23        this%elements(:) = v%elements(:)  ! { dg-error "is not a member of" }
24     end select
26   end subroutine bar
28 end