Skip to content

Commit 4443314

Browse files
authored
[NFC] Fix uninitialized scalar field in constructor. (llvm#118324)
Non-static class field is not initialized in constructor.
1 parent db9057e commit 4443314

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clang-tools-extra/clangd/index/MemIndex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class MemIndex : public SymbolIndex {
9797
// Set of files which were used during this index build.
9898
llvm::StringSet<> Files;
9999
// Contents of the index (symbols, references, etc.)
100-
IndexContents IdxContents;
100+
IndexContents IdxContents = IndexContents::None;
101101
std::shared_ptr<void> KeepAlive; // poor man's move-only std::any
102102
// Size of memory retained by KeepAlive.
103103
size_t BackingDataSize = 0;

clang-tools-extra/clangd/index/dex/Dex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ class Dex : public SymbolIndex {
146146
// Set of files which were used during this index build.
147147
llvm::StringSet<> Files;
148148
// Contents of the index (symbols, references, etc.)
149-
IndexContents IdxContents;
149+
IndexContents IdxContents = IndexContents::None;
150150
// Size of memory retained by KeepAlive.
151151
size_t BackingDataSize = 0;
152152
};

0 commit comments

Comments
 (0)