Skip to content

Commit fa3b1b5

Browse files
committed
[flang][NFC] Document an intentional violation of the ISO standard
This compiler (like all others) allows OPTIONAL dummy arguments to appear as arguments to some intrinsic functions that are specified as disallowing them; document this interpretation better.
1 parent 47b4c6a commit fa3b1b5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

flang/docs/Extensions.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,20 @@ end
189189
`PROCEDURE(), POINTER, NOPASS` derived type components.
190190
Such procedures may *not* be referenced as implicitly typed functions
191191
without first being associated with a function pointer.
192+
* Some intrinsic functions (`COUNT`, `LBOUND`, `LCOBOUND`, `TRANSFER`,
193+
`UBOUND`, and `UCOBOUND`) have arguments (usually `DIM=`) that are documented
194+
as not allowing `OPTIONAL` dummy arguments to appear as their values.
195+
This prohibition appeared on the `DIM=` arguments of more
196+
intrinsic functions in earlier revisions of the ISO standard.
197+
(Perhaps these are meant to avoid misunderstanding these arguments,
198+
which appear in square brackets in the synopses, as if their dynamic
199+
presence at runtime could affect the semantics of the intrinsic in
200+
the same way as the static presence or absence of the argument does
201+
at compilation time, which would not be possible.)
202+
No compiler seems to enforce this requirement, and we interpret it
203+
to mean that a`OPTIONAL` dummy argument may appear but must be present
204+
during execution, just as a pointer argument must be associated or an
205+
allocatable argument must be allocated.
192206

193207
## Extensions, deletions, and legacy features supported by default
194208

0 commit comments

Comments
 (0)