5 ! This used to fail because of incorrect compile-time typespec on the
6 ! SELECT TYPE selector.
8 ! This is the test-case from PR 45795.
9 ! Contributed by Salvatore Filippone, sfilippone@uniroma2.it.
23 type, extends(base) :: s_base
25 procedure, pass(a) :: cp_to_foo => s_base_cp_to_foo
30 type, extends(s_base) :: s_foo
33 integer, allocatable :: ia(:), ja(:)
34 real, allocatable :: val(:)
38 procedure, pass(a) :: cp_to_foo => s_cp_foo_to_foo
44 subroutine s_base_cp_to_foo(a,b,info)
45 import :: s_base, s_foo
46 class(s_base), intent(in) :: a
47 class(s_foo), intent(inout) :: b
48 integer, intent(out) :: info
49 end subroutine s_base_cp_to_foo
53 subroutine s_cp_foo_to_foo(a,b,info)
55 class(s_foo), intent(in) :: a
56 class(s_foo), intent(inout) :: b
57 integer, intent(out) :: info
58 end subroutine s_cp_foo_to_foo
64 subroutine trans2(a,b)
68 class(s_base), intent(out) :: a
69 class(base), intent(in) :: b
78 call b%cp_to_foo(tmp,info)
81 write(*,*) 'Invalid dynamic type'
84 if (info /= 0) write(*,*) 'Error code ',info