111
|
1 ! { dg-do compile }
|
|
2 !
|
|
3 ! PR 60507: Passing function call into procedure argument not caught
|
|
4 !
|
|
5 ! Contributed by Vladimir Fuka <vladimir.fuka@gmail.com>
|
|
6
|
|
7 type :: t
|
|
8 procedure(g), pointer, nopass :: ppc => g
|
|
9 end type
|
|
10
|
|
11 procedure(g), pointer :: pp => g
|
|
12 type(t)::x
|
|
13
|
|
14 print *, f(g)
|
|
15 print *, f(g()) ! { dg-error "Expected a procedure for argument" }
|
|
16 print *, f(pp)
|
|
17 print *, f(pp()) ! { dg-error "Expected a procedure for argument" }
|
|
18 print *, f(x%ppc)
|
|
19 print *, f(x%ppc()) ! { dg-error "Expected a procedure for argument" }
|
|
20
|
|
21 contains
|
|
22
|
|
23 real function f(fun)
|
|
24 procedure(g) :: fun
|
|
25 f = fun()
|
|
26 end function
|
|
27
|
|
28 real function g()
|
|
29 g = 1.
|
|
30 end function
|
|
31
|
|
32 end
|