[llvm] 5ab0894 - Explicitly more Error when returning it (NFC)

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 16 07:08:40 PST 2023


Author: Mehdi Amini
Date: 2023-01-16T15:07:46Z
New Revision: 5ab0894fd570b74907255a4e70c716abd1b5063a

URL: https://github.com/llvm/llvm-project/commit/5ab0894fd570b74907255a4e70c716abd1b5063a
DIFF: https://github.com/llvm/llvm-project/commit/5ab0894fd570b74907255a4e70c716abd1b5063a.diff

LOG: Explicitly more Error when returning it (NFC)

This is an attempt to fix a build failure:

llvm/lib/Object/ELFObjectFile.cpp:300:12: error: call to deleted constructor of 'llvm::Error'
    return E;

Added: 
    

Modified: 
    llvm/lib/Object/ELFObjectFile.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Object/ELFObjectFile.cpp b/llvm/lib/Object/ELFObjectFile.cpp
index c293fddb7224..ebc57bd04be7 100644
--- a/llvm/lib/Object/ELFObjectFile.cpp
+++ b/llvm/lib/Object/ELFObjectFile.cpp
@@ -297,7 +297,7 @@ Expected<SubtargetFeatures> ELFObjectFileBase::getRISCVFeatures() const {
 
   RISCVAttributeParser Attributes;
   if (Error E = getBuildAttributes(Attributes)) {
-    return E;
+    return std::move(E);
   }
 
   std::optional<StringRef> Attr =


        


More information about the llvm-commits mailing list