[flang-commits] [flang] [flang] Fixed regression in copy-in/copy-out (PR #161259)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Mon Nov 10 11:55:13 PST 2025


================
@@ -1575,28 +1559,33 @@ class CopyInOutExplicitInterface {
 // procedures with explicit interface, it's expected that "dummy" is not null.
 // For procedures with implicit interface dummy may be null.
 //
+// Returns std::optional<bool> indicating whether the copy is known to be
+// needed (true) or not needed (false); returns std::nullopt if the necessity
+// of the copy is undetermined.
+//
 // Note that these copy-in and copy-out checks are done from the caller's
 // perspective, meaning that for copy-in the caller need to do the copy
 // before calling the callee. Similarly, for copy-out the caller is expected
 // to do the copy after the callee returns.
-bool MayNeedCopy(const ActualArgument *actual,
+std::optional<bool> ActualArgNeedsCopy(const ActualArgument *actual,
     const characteristics::DummyArgument *dummy, FoldingContext &fc,
     bool forCopyOut) {
+  constexpr auto unknown = std::nullopt;
----------------
klausler wrote:

maybe this would increase readability if it were visible to clients, but it doesn't improve anything in the implementation.

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


More information about the flang-commits mailing list