[clang-tools-extra] [NFC] Fix uninitialized scalar field in constructor. (PR #118324)

via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 2 11:20:19 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clangd

Author: Zahira Ammarguellat (zahiraam)

<details>
<summary>Changes</summary>

Non-static class field is not initialized in constructor.

---
Full diff: https://github.com/llvm/llvm-project/pull/118324.diff


2 Files Affected:

- (modified) clang-tools-extra/clangd/index/MemIndex.h (+1) 
- (modified) clang-tools-extra/clangd/index/dex/Dex.h (+1) 


``````````diff
diff --git a/clang-tools-extra/clangd/index/MemIndex.h b/clang-tools-extra/clangd/index/MemIndex.h
index fba2c1a7120a2b..879d7750ac0480 100644
--- a/clang-tools-extra/clangd/index/MemIndex.h
+++ b/clang-tools-extra/clangd/index/MemIndex.h
@@ -43,6 +43,7 @@ class MemIndex : public SymbolIndex {
     KeepAlive = std::shared_ptr<void>(
         std::make_shared<Payload>(std::move(BackingData)), nullptr);
     this->BackingDataSize = BackingDataSize;
+    this->IdxContents = IndexContents::All;
   }
 
   template <typename SymbolRange, typename RefRange, typename RelationRange,
diff --git a/clang-tools-extra/clangd/index/dex/Dex.h b/clang-tools-extra/clangd/index/dex/Dex.h
index 69e161d51135b6..f907c9a55b935b 100644
--- a/clang-tools-extra/clangd/index/dex/Dex.h
+++ b/clang-tools-extra/clangd/index/dex/Dex.h
@@ -58,6 +58,7 @@ class Dex : public SymbolIndex {
     KeepAlive = std::shared_ptr<void>(
         std::make_shared<Payload>(std::move(BackingData)), nullptr);
     this->BackingDataSize = BackingDataSize;
+    this->IdxContents = IndexContents::All;
   }
 
   template <typename SymbolRange, typename RefsRange, typename RelationsRange,

``````````

</details>


https://github.com/llvm/llvm-project/pull/118324


More information about the cfe-commits mailing list