@@ -1570,17 +1570,16 @@ class CopyInOutExplicitInterface {
15701570std::optional<bool > ActualArgNeedsCopy (const ActualArgument *actual,
15711571 const characteristics::DummyArgument *dummy, FoldingContext &fc,
15721572 bool forCopyOut) {
1573- constexpr auto unknown = std::nullopt ;
15741573 if (!actual) {
1575- return unknown ;
1574+ return std:: nullopt ;
15761575 }
15771576 if (actual->isAlternateReturn ()) {
1578- return unknown ;
1577+ return std:: nullopt ;
15791578 }
15801579 const auto *dummyObj{dummy
15811580 ? std::get_if<characteristics::DummyDataObject>(&dummy->u )
15821581 : nullptr };
1583- const bool forCopyIn = !forCopyOut;
1582+ const bool forCopyIn{ !forCopyOut} ;
15841583 if (!evaluate::IsVariable (*actual)) {
15851584 // Expressions are copy-in, but not copy-out.
15861585 return forCopyIn;
@@ -1608,7 +1607,7 @@ std::optional<bool> ActualArgNeedsCopy(const ActualArgument *actual,
16081607 if (!check.HaveArrayOrAssumedRankArgs ()) {
16091608 return false ;
16101609 }
1611- if (maybeContigActual) {
1610+ if (maybeContigActual. has_value () ) {
16121611 // We know whether actual arg is contiguous or not
16131612 bool isContiguousActual{maybeContigActual.value ()};
16141613 bool actualArgNeedsCopy{
@@ -1620,13 +1619,13 @@ std::optional<bool> ActualArgNeedsCopy(const ActualArgument *actual,
16201619 return check.DummyNeedsContiguity ();
16211620 }
16221621 } else { // Implicit interface
1623- if (maybeContigActual) {
1622+ if (maybeContigActual. has_value () ) {
16241623 // If known contiguous, don't copy in/out.
16251624 // If known non-contiguous, copy in/out.
1626- return !( maybeContigActual. value ()) ;
1625+ return !* maybeContigActual;
16271626 }
16281627 }
1629- return unknown ;
1628+ return std:: nullopt ;
16301629}
16311630
16321631} // namespace Fortran::evaluate
0 commit comments