[flang-commits] [flang] [Flang][Semantics] Treat function result variables as local in pure definability checks. (PR #192892)

via flang-commits flang-commits at lists.llvm.org
Thu Apr 30 01:14:02 PDT 2026


================
@@ -338,12 +338,16 @@ const Symbol *FindExternallyVisibleObject(
         IsPureProcedure(ultimate.owner()) && IsFunction(ultimate.owner())) {
       return &ultimate;
     }
+  } else if (IsFunctionResult(ultimate)) {
+    // A function result variable is local to its function and not an
+    // externally visible object for C1594 checks.
----------------
jeanPerier wrote:

nit: maybe add F2018 before C1594 or use the F2023 constraint number (prefix by F2023). It is a bit odd to use old constraint number in new code, so at least F2018 should be added before it to help reviewers.

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


More information about the flang-commits mailing list