[flang-commits] [flang] flang: allow EXIT to accept integer arguments of any kind (PR #174610)

via flang-commits flang-commits at lists.llvm.org
Tue Jan 27 02:46:54 PST 2026


================
@@ -2158,6 +2158,12 @@ std::optional<SpecificCall> IntrinsicInterface::Match(
       break;
     case KindCode::defaultIntegerKind:
       argOk = type->kind() == defaults.GetDefaultKind(TypeCategory::Integer);
+      if (!argOk && name == "exit"s) {
+        messages.Say(arg->sourceLocation(),
+            "'exit' intrinsic converts INTEGER(kind=%d) to default INTEGER kind"_en_US,
+            type->kind());
+        argOk = true;  
+      }
----------------
blazie2004 wrote:

1. Added test case exit_kind.f90 that verifies the warning is emitted
2. Changed to use context.Warn() with Portability warning
3. Correctly matching on KindCode::any (used by AnyInt)

Test suite passes. The warning correctly appears for non-default integer 
kinds and is silent for default kinds.

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


More information about the flang-commits mailing list