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] Accept proc ptr function result as actual argument without INTENT
A dummy procedure pointer with no INTENT attribute may associate with
an actual argument that is the result of a reference to a function that
returns a procedure pointer, we think.
Fixes#126950.
Copy file name to clipboardExpand all lines: flang/test/Semantics/call09.f90
+2-4Lines changed: 2 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -87,8 +87,7 @@ subroutine test1 ! 15.5.2.9(5)
87
87
call s02(p) ! ok
88
88
!ERROR: Actual procedure argument has interface incompatible with dummy argument 'p=': function results have distinct types: REAL(4) vs INTEGER(4)
89
89
call s02(ip)
90
-
!ERROR: Actual argument associated with procedure pointer dummy argument 'p=' must be a pointer unless INTENT(IN)
91
-
call s02(procptr())
90
+
call s02(procptr()) ! believed to be ok
92
91
call s02(null()) ! ok
93
92
!ERROR: Actual argument associated with procedure pointer dummy argument 'p=' must be a pointer unless INTENT(IN)
94
93
call s05(null())
@@ -99,8 +98,7 @@ subroutine test1 ! 15.5.2.9(5)
99
98
call s02b(p) ! ok
100
99
!ERROR: Actual argument function associated with procedure dummy argument 'p=' is not compatible: function results have distinct types: REAL(4) vs INTEGER(4)
101
100
call s02b(ip)
102
-
!ERROR: Actual argument associated with procedure pointer dummy argument 'p=' must be a pointer unless INTENT(IN)
103
-
call s02b(procptr())
101
+
call s02b(procptr()) ! believed to be ok
104
102
call s02b(null())
105
103
!ERROR: Actual argument associated with procedure pointer dummy argument 'p=' must be a pointer unless INTENT(IN)
0 commit comments