[clang] a4703e5 - [clang] Remove std::move in GenerateModuleAction::CreateMultiplexConsumer (NFC)

Jie Fu via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 7 18:20:07 PST 2024


Author: Jie Fu
Date: 2024-03-08T10:19:07+08:00
New Revision: a4703e5bccc63eca45e0e4bff8f04f82d8622ebe

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

LOG: [clang] Remove std::move in GenerateModuleAction::CreateMultiplexConsumer (NFC)

llvm-project/clang/lib/Frontend/FrontendActions.cpp:213:10:
error: moving a local object in a return statement prevents copy elision [-Werror,-Wpessimizing-move]
  213 |   return std::move(Consumers);
      |          ^
/Users/jiefu/llvm-project/clang/lib/Frontend/FrontendActions.cpp:213:10: note: remove std::move call here
  213 |   return std::move(Consumers);
      |          ^~~~~~~~~~         ~
1 error generated.

Added: 
    

Modified: 
    clang/lib/Frontend/FrontendActions.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp
index cd9b9923421c69..50338bfa670f83 100644
--- a/clang/lib/Frontend/FrontendActions.cpp
+++ b/clang/lib/Frontend/FrontendActions.cpp
@@ -210,7 +210,7 @@ GenerateModuleAction::CreateMultiplexConsumer(CompilerInstance &CI,
       +CI.getFrontendOpts().BuildingImplicitModule));
   Consumers.push_back(CI.getPCHContainerWriter().CreatePCHContainerGenerator(
       CI, std::string(InFile), OutputFile, std::move(OS), Buffer));
-  return std::move(Consumers);
+  return Consumers;
 }
 
 std::unique_ptr<ASTConsumer>


        


More information about the cfe-commits mailing list