diff --git a/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp b/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp index 346eadbdea1e5..514c2e2e1fe14 100644 --- a/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp +++ b/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp @@ -715,7 +715,7 @@ GenericDeviceTy::getKernelEnvironmentForKernel(StringRef Name, // Retrieve kernel environment object for the kernel. GenericGlobalHandlerTy &GHandler = Plugin::get().getGlobalHandler(); if (auto Err = GHandler.readGlobalFromImage(*this, Image, KernelEnv)) - return Err; + return std::move(Err); return KernelEnv.getValue(); }