[flang-commits] [flang] [llvm] [flang] Enumeration Type: (PR 3/5) Intrinsics + I/O + Modules (PR #193235)
via flang-commits
flang-commits at lists.llvm.org
Wed Jul 1 00:22:35 PDT 2026
================
@@ -3864,6 +4080,25 @@ std::optional<SpecificCall> IntrinsicProcTable::Implementation::Probe(
}
}
}
+
+ // Enumeration type intrinsics: HUGE, NEXT, PREVIOUS, INT
+ if (arguments.size() >= 1 && arguments[0]) {
+ if (auto type{arguments[0]->GetType()}) {
----------------
MattPD wrote:
This dispatch checks only the first actual argument, and does so before the arguments are matched to their dummy-argument names. So a call that passes the enumeration argument by keyword rather than first is not recognized as an enum call:
```fortran
subroutine s
enumeration type :: color
enumerator :: red, green
end enumeration type
integer(8) :: i
i = int(kind=8, a=red)
end subroutine
```
The compiler reports `error: Actual argument for 'a=' has bad type 'color'`. Would matching the arguments to their dummies before deciding whether the enum path applies handle keyword forms like `int(kind=..., a=...)`?
https://github.com/llvm/llvm-project/pull/193235
More information about the flang-commits
mailing list