diff --git a/offload/libomptarget/OpenMP/InteropAPI.cpp b/offload/libomptarget/OpenMP/InteropAPI.cpp index a694af14c1bb..2eaf376e7426 100644 --- a/offload/libomptarget/OpenMP/InteropAPI.cpp +++ b/offload/libomptarget/OpenMP/InteropAPI.cpp @@ -219,7 +219,7 @@ omp_interop_val_t *__tgt_interop_get(ident_t *LocRef, int32_t InteropType, auto DeviceOrErr = PM->getDevice(DeviceNum); if (!DeviceOrErr) { - [[maybe_unused]] std::string ErrStr = toString(DeviceOrErr.takeError()); + std::string ErrStr = toString(DeviceOrErr.takeError()); ODBG(ODT_Interface) << "Couldn't find device " << DeviceNum << " while constructing interop object: " << ErrStr; return omp_interop_none; diff --git a/offload/libomptarget/PluginManager.cpp b/offload/libomptarget/PluginManager.cpp index 924a986fbb10..41b653a60adf 100644 --- a/offload/libomptarget/PluginManager.cpp +++ b/offload/libomptarget/PluginManager.cpp @@ -59,7 +59,7 @@ void PluginManager::deinit() { continue; if (auto Err = Plugin->deinit()) { - [[maybe_unused]] std::string InfoMsg = toString(std::move(Err)); + std::string InfoMsg = toString(std::move(Err)); ODBG(ODT_Deinit) << "Failed to deinit plugin: " << InfoMsg; } Plugin.release(); @@ -73,7 +73,7 @@ bool PluginManager::initializePlugin(GenericPluginTy &Plugin) { return true; if (auto Err = Plugin.init()) { - [[maybe_unused]] std::string InfoMsg = toString(std::move(Err)); + std::string InfoMsg = toString(std::move(Err)); ODBG(ODT_Init) << "Failed to init plugin: " << InfoMsg; return false; } @@ -106,7 +106,7 @@ bool PluginManager::initializeDevice(GenericPluginTy &Plugin, auto Device = std::make_unique(&Plugin, UserId, DeviceId); if (auto Err = Device->init()) { - [[maybe_unused]] std::string InfoMsg = toString(std::move(Err)); + std::string InfoMsg = toString(std::move(Err)); ODBG(ODT_Init) << "Failed to init device " << DeviceId << ": " << InfoMsg; return false; } diff --git a/offload/plugins-nextgen/common/src/PluginInterface.cpp b/offload/plugins-nextgen/common/src/PluginInterface.cpp index 4ec836636b57..7847b4f77d7a 100644 --- a/offload/plugins-nextgen/common/src/PluginInterface.cpp +++ b/offload/plugins-nextgen/common/src/PluginInterface.cpp @@ -1656,7 +1656,7 @@ int32_t GenericPluginTy::is_initialized() const { return Initialized; } int32_t GenericPluginTy::isPluginCompatible(StringRef Image) { auto HandleError = [&](Error Err) -> bool { - [[maybe_unused]] std::string ErrStr = toString(std::move(Err)); + std::string ErrStr = toString(std::move(Err)); ODBG(OLDT_Init) << "Failure to check validity of image " << Image.data() << ": " << ErrStr; return false; @@ -1685,7 +1685,7 @@ int32_t GenericPluginTy::isPluginCompatible(StringRef Image) { int32_t GenericPluginTy::isDeviceCompatible(int32_t DeviceId, StringRef Image) { auto HandleError = [&](Error Err) -> bool { - [[maybe_unused]] std::string ErrStr = toString(std::move(Err)); + std::string ErrStr = toString(std::move(Err)); ODBG(OLDT_Init) << "Failure to check validity of image " << Image << ": " << ErrStr; return false; @@ -2069,7 +2069,7 @@ int32_t GenericPluginTy::use_auto_zero_copy(int32_t DeviceId) { int32_t GenericPluginTy::is_accessible_ptr(int32_t DeviceId, const void *Ptr, size_t Size) { auto HandleError = [&](Error Err) -> bool { - [[maybe_unused]] std::string ErrStr = toString(std::move(Err)); + std::string ErrStr = toString(std::move(Err)); ODBG(OLDT_Device) << "Failure while checking accessibility of pointer " << Ptr << " for device " << DeviceId << ": " << ErrStr; return false;