Author: Zahira Ammarguellat
Date: 2025-05-16T07:56:36-04:00
New Revision: 38e0f983ada4cb753bcaafaf8fa9e2f2dfdef2ba

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

LOG: [CLANGD] [NFC] Fix proposed by static analyzer. (#140116)

This fixes an issue reported by the sanitizer with the following error
message:
`copy_constructor_call: IndexOpts` is passed by value as a parameter to`
clang::index::IndexingOptions::IndexingOptions` instead of being moved.

Added: 
    

Modified: 
    clang-tools-extra/clangd/index/FileIndex.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/index/FileIndex.cpp 
b/clang-tools-extra/clangd/index/FileIndex.cpp
index 0fe069783d64f..c49de377d54ca 100644
--- a/clang-tools-extra/clangd/index/FileIndex.cpp
+++ b/clang-tools-extra/clangd/index/FileIndex.cpp
@@ -79,7 +79,8 @@ SlabTuple indexSymbols(ASTContext &AST, Preprocessor &PP,
 
   SymbolCollector Collector(std::move(CollectorOpts));
   Collector.setPreprocessor(PP);
-  index::indexTopLevelDecls(AST, PP, DeclsToIndex, Collector, IndexOpts);
+  index::indexTopLevelDecls(AST, PP, DeclsToIndex, Collector,
+                            std::move(IndexOpts));
   if (MacroRefsToIndex)
     Collector.handleMacros(*MacroRefsToIndex);
 


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to