[OpenMP][FIX] Repair ExclusiveAccess move semantic snafu

This commit is contained in:
Johannes Doerfert 2022-03-25 16:00:06 -05:00
parent b9fd8f34ae
commit 7dfad948f1
1 changed files with 4 additions and 4 deletions

View File

@ -28,7 +28,7 @@ template <typename Ty> struct ProtectedObj {
/// Get an exclusive access Accessor object. \p DoNotGetAccess allows to /// Get an exclusive access Accessor object. \p DoNotGetAccess allows to
/// create an accessor that is not owning anything based on a boolean /// create an accessor that is not owning anything based on a boolean
/// condition. /// condition.
AccessorTy &&getExclusiveAccessor(bool DoNotGetAccess = false); AccessorTy getExclusiveAccessor(bool DoNotGetAccess = false);
private: private:
Ty Obj; Ty Obj;
@ -91,10 +91,10 @@ private:
}; };
template <typename Ty> template <typename Ty>
Accessor<Ty> &&ProtectedObj<Ty>::getExclusiveAccessor(bool DoNotGetAccess) { Accessor<Ty> ProtectedObj<Ty>::getExclusiveAccessor(bool DoNotGetAccess) {
if (DoNotGetAccess) if (DoNotGetAccess)
return std::move(Accessor<Ty>()); return Accessor<Ty>();
return std::move(Accessor<Ty>(*this)); return Accessor<Ty>(*this);
} }
#endif #endif