[clang-tools-extra] [CLANGD] Fix proposed by sanitizer. (PR #140116)
Zahira Ammarguellat via cfe-commits
cfe-commits at lists.llvm.org
Thu May 15 11:23:24 PDT 2025
https://github.com/zahiraam created https://github.com/llvm/llvm-project/pull/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.
>From 5482b1859fcc98358ebea0ccab69c5553d7db307 Mon Sep 17 00:00:00 2001
From: Zahira Ammarguellat <zahira.ammarguellat at intel.com>
Date: Thu, 15 May 2025 11:16:48 -0700
Subject: [PATCH] [CLANGD] Fix proposed by sanitizer.
---
clang-tools-extra/clangd/index/FileIndex.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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);
More information about the cfe-commits
mailing list