<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/67920>67920</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang] transformational intrinsic function in statement function
</td>
</tr>
<tr>
<th>Labels</th>
<td>
flang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
k-arrows
</td>
</tr>
</table>
<pre>
Consider the following:
```console
$ cat a.f90
logical g,l(2)
g(x)=all(l)
end
```
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50535.
As mentioned in this bugzilla comment, ifort rejects this program.
https://godbolt.org/z/sEYWjTxz1
Gfortran and Flang-new accept this program. If I understand correctly, this program should be rejected. Below is a quote from https://j3-fortran.org/doc/year/18/18-007r1.pdf. Is my understanding correct?
```txt
15.6.4 Statement function
A statement function is a function defined by a single statement.
...
If scalar-expr contains a reference to a function, the reference shall not require an explicit interface, the function shall not require an explicit interface unless it is an intrinsic function, the function shall not be a transformational intrinsic, and the result shall be scalar.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVM1u4zYQfhr6MrBAkZZtHXTIxlWR8xYoeioocigxpUgvSdV2nr6gpSRa76JYwJAxf99880cRo-kdYkOqL6Q6bcSUBh-af7YiBH-Jm86rW_PsXTQKA6QBQXtr_cW4nvAnQk-EPpE9nX_Su-gtLlq2AykSiELXdFZZ3xspLPSEPVvCjoywerb0hB2vWeInYbPJfpjQqYc0i3j_fkWEIaVzzGxYS1jbS1n0bip86Alru6l_M9YKwto4-Mvf3dQXsjeEt0YRfqpoxatihnqKMKJLxjtUYBykwUR4jwfpx2wl7BmM9iFBwFeUKc5u5-D7IMYF6YGQV523aSH0lpn89tefr39c38p1Jb9n1CAcCKegtcL1W4cXEFLiOX2fBV40vMDkFIaYsrv0IaBM9pbprV0hDn6yCjpc-KIq4AtafwETQcC3yScEHfz40MVXvl34LLyVl4S1NxSBsLY83j9bSg-hLM5KF_ASYbytOBnXv9MivF0X-jHHdE2zpqyKfbGDr0kkzE0GPTmZB7EOe4L4g30u4kNSqE0eXncDAdG43uJnULEGK4rvxBcNUQorwhav5wDSuySMy9gBNQZ0EiH5Vaq5z7gyx0FYC87nxfg2mYAgHOD1bI00CYxLGLSQ-B74wfkX42ByFmOErIvZxbgUjItG_sDpJ9AdgoA8zKh9GEW2CvsJkSPzGs0VxcmmJbbDpS_Fw-g2quGq5rXYYFPu63154AdWb4aG8nJXcVrpSkvNd6zikh407tmR6a5TbGMaRhkvKS3LijFaF_LY7Snd63rH5UFVnOwojsLYwtp_x7x8GxPjhM3-UDO6saJDG--vFWM6XwlhLD9cocn-227qI9lRa2KKnwjJJHt_4u53RarT_zRjtVzuJyu3mYJtHg7cpGHqCulHwtqcc_nbnoPPN0dYey8hEtbeq_gvAAD__3WuxhI">