[flang-commits] [flang] [flang] Fix: Reject OPTIONAL dummy arguments for DIM in ALL/ANY/COUNT (PR #171971)

Sairudra More via flang-commits flang-commits at lists.llvm.org
Sat Dec 13 00:05:04 PST 2025


Saieiei wrote:

I wasn't aware the prohibition was removed for `ALL/ANY` in the newer standard.  Thanks for the clarification on F2023 @klausler  but i have few questions that would help me understand the path forward:

1. Should Flang target F2023 compliance here rather than F2018? I based my fix on F2018 ยง16.9.5, but it sounds like F2023 is the right reference.

2. For the intrinsics still prohibited in F2023 (COUNT, LBOUND, LCOBOUND, TRANSFER, UBOUND, UCOBOUND), your PR #172105 mentions "no compiler seems to enforce this requirement" and treats it as an extension. Should these remain as warnings (or no diagnostic at all) rather than errors?

3. The original code had a conditional gate (`if (dummy[*dimArg].optionality == Optionality::required)`) that prevented any warning from appearing for ALL/ANY/COUNT. Was that intentional to suppress warnings entirely, or was it a bug that should be fixed?

4. Given your work in #172105, should I close this PR in favor of that approach, or would you like me to revise this to align with F2023 semantics?

Happy to adjust or close as appropriate!

https://github.com/llvm/llvm-project/pull/171971


More information about the flang-commits mailing list