You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[flang] Downgrade inappropriate error message to a warning
It may not be great practice to pass a procedure (or procedure pointer)
with an implicit interface as an actual argument to correspond with
a dummy procedure (pointer), but it's not an error. Change to a
warning, and modify tests accordingly.
Differential Revision: https://reviews.llvm.org/D108932
Copy file name to clipboardExpand all lines: flang/test/Semantics/call09.f90
-9Lines changed: 0 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -58,9 +58,6 @@ subroutine test1 ! 15.5.2.9(5)
58
58
procedure(realfunc), pointer:: p
59
59
procedure(intfunc), pointer:: ip
60
60
integer, pointer:: intPtr
61
-
external:: extfunc
62
-
external:: extfuncPtr
63
-
pointer:: extfuncPtr
64
61
p => realfunc
65
62
ip => intfunc
66
63
call s01(realfunc) ! ok
@@ -79,8 +76,6 @@ subroutine test1 ! 15.5.2.9(5)
79
76
call s01(null(intPtr))
80
77
!ERROR: Actual argument associated with procedure dummy argument 'p=' is typeless
81
78
call s01(B"0101")
82
-
!ERROR: Actual procedure argument has an implicit interface which is not known to be compatible with dummy argument 'p=' which has an explicit interface
83
-
call s01(extfunc)
84
79
!ERROR: Actual argument associated with procedure pointer dummy argument 'p=' must be a POINTER unless INTENT(IN)
85
80
call s02(realfunc)
86
81
call s02(p) ! ok
@@ -94,10 +89,6 @@ subroutine test1 ! 15.5.2.9(5)
94
89
call s02(null(p))
95
90
!ERROR: Actual argument associated with procedure pointer dummy argument 'p=' must be a POINTER unless INTENT(IN)
96
91
call s02(sin)
97
-
!ERROR: Actual procedure argument has an implicit interface which is not known to be compatible with dummy argument 'p=' which has an explicit interface
98
-
call s02(extfunc)
99
-
!ERROR: Actual procedure argument has an implicit interface which is not known to be compatible with dummy argument 'p=' which has an explicit interface
! Verifies that warnings issue when actual arguments with implicit
3
+
! interfaces are associated with dummy procedures and dummy procedure
4
+
! pointers whose interfaces are explicit.
5
+
module m
6
+
contains
7
+
realfunctionrealfunc(x)
8
+
real, intent(in) :: x
9
+
realfunc = x
10
+
endfunction
11
+
subroutines00(p0)
12
+
procedure(realfunc) :: p0
13
+
endsubroutine
14
+
subroutines01(p1)
15
+
procedure(realfunc), pointer, intent(in) :: p1
16
+
endsubroutine
17
+
subroutines02(p2)
18
+
procedure(realfunc), pointer:: p2
19
+
endsubroutine
20
+
subroutinetest
21
+
external:: extfunc
22
+
external:: extfuncPtr
23
+
pointer:: extfuncPtr
24
+
!CHECK: Actual procedure argument has an implicit interface which is not known to be compatible with dummy argument 'p0=' which has an explicit interface
25
+
call s00(extfunc)
26
+
!CHECK: Actual procedure argument has an implicit interface which is not known to be compatible with dummy argument 'p1=' which has an explicit interface
27
+
call s01(extfunc)
28
+
!CHECK: Actual procedure argument has an implicit interface which is not known to be compatible with dummy argument 'p2=' which has an explicit interface
0 commit comments