[Libomptarget] Add missing explicit moves on llvm::Error
authorJoseph Huber <jhuber6@vols.utk.edu>
Mon, 20 Mar 2023 17:00:01 +0000 (12:00 -0500)
committerJoseph Huber <jhuber6@vols.utk.edu>
Mon, 20 Mar 2023 17:00:01 +0000 (12:00 -0500)
Summary:
Some older compilers, which we still support, have problems handling the
copy elision that allows us to directly move an `Error` to an
`Expected`. This patch adds explicit moves to remove the error. Same as
last patch but I forgot this one.

openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp

index 5a31c53..f9b0371 100644 (file)
@@ -1886,7 +1886,7 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy {
                              /* Number of accessible agents (out) */ nullptr,
                              /* Accessible agents */ nullptr);
     if (auto Err = Plugin::check(Status, "Error in hsa_amd_pointer_info: %s"))
-      return Err;
+      return std::move(Err);
 
     // The buffer may be locked or allocated through HSA allocators. Assume that
     // the buffer is host pinned if the runtime reports a HSA type.