[flang-commits] [flang] [flang] Add control and a portability warning for an extension (PR #137995)

Andre Kuhlenschmidt via flang-commits flang-commits at lists.llvm.org
Wed Apr 30 10:31:13 PDT 2025


================
@@ -581,20 +581,38 @@ static void CheckExplicitDataArg(const characteristics::DummyDataObject &dummy,
               "Polymorphic scalar may not be associated with a %s array"_err_en_US,
               dummyName);
         }
+        bool isOkBecauseContiguous{
+            context.IsEnabled(
+                common::LanguageFeature::ContiguousOkForSeqAssociation) &&
+            actualLastSymbol &&
+            evaluate::IsContiguous(*actualLastSymbol, foldingContext)};
         if (actualIsArrayElement && actualLastSymbol &&
-            !evaluate::IsContiguous(*actualLastSymbol, foldingContext) &&
             !dummy.ignoreTKR.test(common::IgnoreTKR::Contiguous)) {
           if (IsPointer(*actualLastSymbol)) {
-            basicError = true;
-            messages.Say(
-                "Element of pointer array may not be associated with a %s array"_err_en_US,
-                dummyName);
+            if (isOkBecauseContiguous) {
----------------
akuhlens wrote:

What are your thoughts on factoring out the code duplication here and below into a helper?

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


More information about the flang-commits mailing list