[flang-commits] [flang] [flang] Implemented a warning about contiguity of compile time constant values (PR #161084)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Mon Sep 29 13:59:09 PDT 2025


================
@@ -799,12 +799,20 @@ Expr<Type<TypeCategory::Logical, KIND>> FoldIntrinsicFunction(
     }
   } else if (name == "is_contiguous") {
     if (args.at(0)) {
+      auto warnContiguous = [&]() {
+        if (auto source{args[0]->sourceLocation()}) {
+          context.Warn(common::UsageWarning::ConstantIsContiguous, *source,
+              "constant values constructed at compile time are likely to be contiguous"_warn_en_US);
----------------
klausler wrote:

The text of this message isn't really actionable; what should the programmer do?

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


More information about the flang-commits mailing list