1! { dg-do compile }
2!
3! PR 40869: [F03] PPC assignment checking
4!
5! Contributed by Janus Weil <janus@gcc.gnu.org>
6
7implicit none
8
9interface func
10  procedure f1,f2 ! { dg-error "Ambiguous interfaces" }
11end interface
12
13interface operator(.op.)
14  procedure f1,f2 ! { dg-error "Ambiguous interfaces" }
15end interface
16
17type :: t1
18  procedure(integer), pointer, nopass :: ppc
19end type
20
21type :: t2
22  procedure(real), pointer, nopass :: ppc
23end type
24
25type(t1) :: o1
26type(t2) :: o2
27procedure(logical),pointer :: pp1
28procedure(complex),pointer :: pp2
29
30pp1 => pp2        ! { dg-error "Type mismatch in function result" }
31pp2 => o2%ppc     ! { dg-error "Type mismatch in function result" }
32
33o1%ppc => pp1     ! { dg-error "Type mismatch in function result" }
34o1%ppc => o2%ppc  ! { dg-error "Type mismatch in function result" }
35
36contains
37
38  real function f1(a,b)
39    real,intent(in) :: a,b
40    f1 = a + b
41  end function
42
43  integer function f2(a,b)
44    real,intent(in) :: a,b
45    f2 = a - b
46  end function
47
48end
49
50