Skip to content

Commit 38e0f98

Browse files
authored
[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.
1 parent 25c4478 commit 38e0f98

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)