[flang-commits] [flang] flang: allow EXIT to accept integer arguments of any kind (PR #174610)
Andre Kuhlenschmidt via flang-commits
flang-commits at lists.llvm.org
Wed Jan 21 09:54:53 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;
+ }
----------------
akuhlens wrote:
This is an error that you are emitting here and I imagine that you are not able to actually hit it since it isn't in the test. You probably want to use something like `context.Warn(Portability, "message", ...)`. You should also probably match on the `KindCode` that is used by `AnyInt` which I don't think is `defaultIntegerKind` but I could be wrong.
https://github.com/llvm/llvm-project/pull/174610
More information about the flang-commits
mailing list