[flang-commits] [flang] [flang] Expand parent component in procedure pointer component refere… (PR #78593)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Thu Jan 18 08:21:10 PST 2024


================
@@ -2391,9 +2393,15 @@ auto ExpressionAnalyzer::AnalyzeProcedureComponentRef(
               ProcedureDesignator{*resolution}, std::move(arguments)};
         } else if (dataRef.has_value()) {
           if (sym->attrs().test(semantics::Attr::NOPASS)) {
-            return CalleeAndArguments{
-                ProcedureDesignator{Component{std::move(*dataRef), *sym}},
-                std::move(arguments)};
+            const auto *dtSpec{GetDerivedTypeSpec(dtExpr->GetType())};
+            if (dtSpec && dtSpec->scope()) {
+              if (auto component{CreateComponent(std::move(*dataRef), *sym,
+                      *dtSpec->scope(), /*C919AlreadyEnforced=*/true)}) {
+                return CalleeAndArguments{
+                    ProcedureDesignator{std::move(*component)},
+                    std::move(arguments)};
+              }
+            }
----------------
klausler wrote:

The current code always calls `CalleeAndArgument`.  The new code might not.  Is that what you want?  Should there be an error if nothing can be returned?

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


More information about the flang-commits mailing list