[Openmp-commits] [openmp] 7dfad94 - [OpenMP][FIX] Repair ExclusiveAccess move semantic snafu

Johannes Doerfert via Openmp-commits openmp-commits at lists.llvm.org
Fri Mar 25 14:01:55 PDT 2022


Author: Johannes Doerfert
Date: 2022-03-25T16:00:53-05:00
New Revision: 7dfad948f12a8200e5d01f3815482ce9a00d4103

URL: https://github.com/llvm/llvm-project/commit/7dfad948f12a8200e5d01f3815482ce9a00d4103
DIFF: https://github.com/llvm/llvm-project/commit/7dfad948f12a8200e5d01f3815482ce9a00d4103.diff

LOG: [OpenMP][FIX] Repair ExclusiveAccess move semantic snafu

Added: 
    

Modified: 
    openmp/libomptarget/include/ExclusiveAccess.h

Removed: 
    


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


        


More information about the Openmp-commits mailing list