Debian Codegraph @

gcc/testsuite/gfortran.dg/proc_ptr_56.f90

raw
1 ! { dg-do compile }
2 ! { dg-options "-std=f2003" }
3 !
4 ! Test the fix for pr117434, in which the F2008 addition of being permitted to
5 ! pass an external, internal or module procedure to a dummy procedure pointer
6 ! gave the error "Expected a procedure pointer for argument ‘<arg_name>’ at (1).
7 !
8 ! This testcase checks that -std=f2008 or later is required..
9 !
10 ! Contributed by Damian Rouson <[email protected]>
11 !
12 module julienne_test_description_m
13 implicit none
14
15 abstract interface
16 logical function test_function_i()
17 end function
18 end interface
19
20 type test_description_t
21 procedure(test_function_i), pointer, nopass :: test_function_
22 end type
23
24 contains
25
26 type(test_description_t) function new_test_description(test_function)
27 procedure(test_function_i), intent(in), pointer :: test_function
28 new_test_description%test_function_ => test_function
29 end function
30
31 end module
32
33 use julienne_test_description_m
34 implicit none
35 type(test_description_t) test_description
36
37 test_description = new_test_description(test) ! { dg-error "Fortran 2008:" }
38
39 contains
40
41 logical function test()
42 test = .true.
43 end function
44
45 end