forked from OSchip/llvm-project
[OpenMP][FIX] Repair ExclusiveAccess move semantic snafu
This commit is contained in:
parent
b9fd8f34ae
commit
7dfad948f1
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue