[flang-commits] [flang] [flang] Better handling of ALLOCATED(pointer) error (PR #186622)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Mon Mar 16 08:12:11 PDT 2026


================
@@ -3802,6 +3802,21 @@ std::optional<SpecificCall> IntrinsicProcTable::Implementation::Probe(
       return HandleC_Devloc(arguments, context);
     } else if (call.name == "null") {
       return HandleNull(arguments, context);
+    } else if (call.name == "allocated") {
+      if (context.languageFeatures().IsEnabled(
+              common::LanguageFeature::AllocatedForAssociated) &&
+          arguments.size() == 1 && arguments[0].has_value()) {
+        auto &arg{*arguments[0]};
----------------
klausler wrote:

Actually, if there's any SCALAR or ARRAY or other keyword, it still fails with a good message when reconsidered as a call to ASSOCIATED.  So no further change is needed.

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


More information about the flang-commits mailing list