[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.
This commit is contained in:
Zahira Ammarguellat 2025-05-16 04:56:36 -07:00 committed by GitHub
parent 25c4478f38
commit 38e0f983ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);