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 IN… (#128771)
…TENT
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.
!ERROR: Actual argument associated with procedure dummy argument 'p=' is typeless
84
84
call s01(B"0101")
85
-
!ERROR: Actual argument associated with procedure pointer dummy argument 'p=' must be a pointer unless INTENT(IN)
85
+
!ERROR: Actual argument associated with procedure pointer dummy argument 'p=' is not a procedure pointer
86
86
call s02(realfunc)
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
-
!ERROR: Actual argument associated with procedure pointer dummy argument 'p=' must be a pointer unless INTENT(IN)
92
+
!ERROR: Actual argument associated with INTENT(IN OUT) procedure pointer dummy argument 'p=' is not definable
93
+
!BECAUSE: 'NULL()' is a null pointer
94
94
call s05(null())
95
-
!ERROR: Actual argument associated with procedure pointer dummy argument 'p=' must be a pointer unless INTENT(IN)
95
+
!ERROR: Actual argument associated with procedure pointer dummy argument 'p=' is not a procedure pointer
96
96
call s02(sin)
97
-
!ERROR: Actual argument associated with procedure pointer dummy argument 'p=' must be a pointer unless INTENT(IN)
97
+
!ERROR: Actual argument associated with procedure pointer dummy argument 'p=' is not a procedure pointer
98
98
call s02b(realfunc)
99
99
call s02b(p) ! ok
100
100
!ERROR: Actual argument function associated with procedure dummy argument 'p=' is not compatible: function results have distinct types: REAL(4) vs INTEGER(4)
101
101
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())
102
+
call s02b(procptr()) ! believed to be ok
104
103
call s02b(null())
105
-
!ERROR: Actual argument associated with procedure pointer dummy argument 'p=' must be a pointer unless INTENT(IN)
104
+
!ERROR: Actual argument associated with procedure pointer dummy argument 'p=' is not a procedure pointer
0 commit comments