File: proc_ptr_comp_20.f90

package info (click to toggle)
gcc-arm-none-eabi 15%3A14.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,099,328 kB
  • sloc: cpp: 3,627,108; ansic: 2,571,498; ada: 834,230; f90: 235,082; makefile: 79,231; asm: 74,984; xml: 51,692; exp: 39,736; sh: 33,298; objc: 15,629; python: 15,069; fortran: 14,429; pascal: 7,003; awk: 5,070; perl: 3,106; ml: 285; lisp: 253; lex: 204; haskell: 135
file content (49 lines) | stat: -rw-r--r-- 999 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
! { dg-do compile }
!
! PR 40869: [F03] PPC assignment checking
!
! Contributed by Janus Weil <janus@gcc.gnu.org>

implicit none

interface func
  procedure f1,f2
end interface

interface operator(.op.)
  procedure f1,f2
end interface

type :: t1
  procedure(integer), pointer, nopass :: ppc
end type

type :: t2
  procedure(real), pointer, nopass :: ppc
end type

type(t1) :: o1
type(t2) :: o2
procedure(logical),pointer :: pp1
procedure(complex),pointer :: pp2

pp1 => pp2        ! { dg-error "Type mismatch in function result" }
pp2 => o2%ppc     ! { dg-error "Type mismatch in function result" }

o1%ppc => pp1     ! { dg-error "Type mismatch in function result" }
o1%ppc => o2%ppc  ! { dg-error "Type mismatch in function result" }

contains

  real function f1(a,b)    ! { dg-error "Ambiguous interfaces" }
    real,intent(in) :: a,b
    f1 = a + b
  end function

  integer function f2(a,b) ! { dg-error "Ambiguous interfaces" }
    real,intent(in) :: a,b
    f2 = a - b
  end function

end