view gcc/testsuite/gfortran.dg/select_type_20.f90 @ 128:fe568345ddd5

fix CbC-example
author mir3636
date Wed, 11 Apr 2018 19:32:28 +0900
parents 04ced10e8804
children 1830386684a0
line wrap: on
line source

! { 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" }