From 26d62674cf5013249f99323d15b6044586e6b3a8 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Thu, 12 Jan 2023 14:37:11 -0600 Subject: [PATCH] [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. --- clang/lib/Driver/ToolChains/AMDGPU.cpp | 2 +- clang/lib/Driver/ToolChains/Cuda.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/lib/Driver/ToolChains/AMDGPU.cpp b/clang/lib/Driver/ToolChains/AMDGPU.cpp index c288236..5849e9c 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 76f4da2..52dd0c2 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 { -- 2.7.4