aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/select_type_20.f90
blob: a247f7b0cfb5cf745b4ee66c27e7bca713670c85 (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
29
30
31
32
33
34
35
! { dg-do compile }
! PR fortran/45848
! PR fortran/47204
!
! Contributed by Harald Anlauf and Zdenek Sojka
!
module gfcbug111
  implicit none

  type, abstract :: inner_product_class
  end type inner_product_class

  type, extends(inner_product_class) :: trivial_inner_product_type
  end type trivial_inner_product_type

contains

  function my_dot_v_v (this,a,b) ! { dg-error "has no IMPLICIT type" }
    class(trivial_inner_product_type), intent(in) :: this
    class(vector_class),               intent(in) :: a,b ! { dg-error "Derived type" }
    real :: my_dot_v_v

    select type (a)
    class is (trivial_vector_type) ! { dg-error "Syntax error in CLASS IS" }
       select type (b) ! { dg-error "Expected TYPE IS" }
       class is (trivial_vector_type) ! { dg-error "Syntax error in CLASS IS" }
       class default
       end select
    class default ! { dg-error "Unclassifiable statement" }
    end select ! { dg-error "Expecting END FUNCTION" }
  end function my_dot_v_v
end module gfcbug111

select type (a)
! { dg-excess-errors "Unexpected end of file" }