[clang] 26d6267 - [Clang] Explicitly move returned values converted to expected
Joseph Huber via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 12 12:38:15 PST 2023
Author: Joseph Huber
Date: 2023-01-12T14:38:03-06:00
New Revision: 26d62674cf5013249f99323d15b6044586e6b3a8
URL: https://github.com/llvm/llvm-project/commit/26d62674cf5013249f99323d15b6044586e6b3a8
DIFF: https://github.com/llvm/llvm-project/commit/26d62674cf5013249f99323d15b6044586e6b3a8.diff
LOG: [Clang] Explicitly move returned values converted to expected
Summary:
These can cause failures on GCC-7 it seems. We should explicitly move
them to prevent this from causing build failures.
Added:
Modified:
clang/lib/Driver/ToolChains/AMDGPU.cpp
clang/lib/Driver/ToolChains/Cuda.cpp
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/AMDGPU.cpp b/clang/lib/Driver/ToolChains/AMDGPU.cpp
index c2882367fe1f3..5849e9cfdb9b5 100644
--- a/clang/lib/Driver/ToolChains/AMDGPU.cpp
+++ b/clang/lib/Driver/ToolChains/AMDGPU.cpp
@@ -770,7 +770,7 @@ AMDGPUToolChain::getSystemGPUArchs(const ArgList &Args) const {
return llvm::createStringError(std::error_code(),
"No AMD GPU detected in the system");
- return GPUArchs;
+ return std::move(GPUArchs);
}
void ROCMToolChain::addClangTargetOptions(
diff --git a/clang/lib/Driver/ToolChains/Cuda.cpp b/clang/lib/Driver/ToolChains/Cuda.cpp
index 76f4da2a704d0..52dd0c2166683 100644
--- a/clang/lib/Driver/ToolChains/Cuda.cpp
+++ b/clang/lib/Driver/ToolChains/Cuda.cpp
@@ -794,7 +794,7 @@ CudaToolChain::getSystemGPUArchs(const ArgList &Args) const {
return llvm::createStringError(std::error_code(),
"No NVIDIA GPU detected in the system");
- return GPUArchs;
+ return std::move(GPUArchs);
}
Tool *CudaToolChain::buildAssembler() const {
More information about the cfe-commits
mailing list