[flang-commits] [clang] [flang] [flang] Enumeration Type: (PR 5/5) Enable (PR #231641)

via flang-commits flang-commits at lists.llvm.org
Thu Oct 15 16:51:50 PDT 2026


================
@@ -168,6 +168,18 @@ page](https://llvm.org/releases/).
   F2023 15.5.2.10 p1). Declare the target `SIMPLE` if it satisfies the
   `SIMPLE` constraints, or give the pointer or dummy an explicit `PURE`
   interface.
+- Added support for the Fortran 2023 non-interoperable `ENUMERATION TYPE`
+  (F2023 7.6.2). An enumeration type is a distinct type whose values are
+  ordered, named enumerators. Supported features:
+  - declaration with `ENUMERATION TYPE` / `ENUMERATOR`, including
+    `ENUMERATION TYPE, PUBLIC/PRIVATE` and use through modules (module files
+    record enumeration types);
+  - enumeration constructors and use as named constants;
+  - relational operators (`==`, `/=`, `<`, `<=`, `>`, `>=`) between values of
+    the same enumeration type, and `SELECT CASE` on enumeration values;
+  - the `INT` intrinsic applied to an enumeration value, and the `HUGE`,
+    `NEXT` and `PREVIOUS` intrinsics;
----------------
MattPD wrote:

Could this note document both compatibility changes: the removal of `-fenumeration-type` and `-fno-enumeration-type`, and the name collision with the new `NEXT` and `PREVIOUS` intrinsic functions? Before this PR, Flang accepted calls to implicit-interface external functions with those names by default. Such calls now need an `EXTERNAL` declaration or an explicit interface.

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


More information about the flang-commits mailing list