Skip to content

Commit bf584c8

Browse files
zahiraamgithub-actions[bot]
authored andcommitted
Automerge: [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.
2 parents d083290 + 38e0f98 commit bf584c8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ SlabTuple indexSymbols(ASTContext &AST, Preprocessor &PP,
7979

8080
SymbolCollector Collector(std::move(CollectorOpts));
8181
Collector.setPreprocessor(PP);
82-
index::indexTopLevelDecls(AST, PP, DeclsToIndex, Collector, IndexOpts);
82+
index::indexTopLevelDecls(AST, PP, DeclsToIndex, Collector,
83+
std::move(IndexOpts));
8384
if (MacroRefsToIndex)
8485
Collector.handleMacros(*MacroRefsToIndex);
8586

0 commit comments

Comments
 (0)