Index: clang-tools-extra/clangd/index/dex/Iterator.cpp =================================================================== --- clang-tools-extra/clangd/index/dex/Iterator.cpp +++ clang-tools-extra/clangd/index/dex/Iterator.cpp @@ -23,7 +23,7 @@ /// tree) and is simply a wrapper around PostingList::const_iterator. class DocumentIterator : public Iterator { public: - DocumentIterator(PostingListRef Documents) + explicit DocumentIterator(PostingListRef Documents) : Documents(Documents), Index(std::begin(Documents)) {} bool reachedEnd() const override { return Index == std::end(Documents); } @@ -85,7 +85,7 @@ /// iterator restores the invariant: all children must point to the same item. class AndIterator : public Iterator { public: - AndIterator(std::vector> AllChildren) + explicit AndIterator(std::vector> AllChildren) : Children(std::move(AllChildren)) { assert(!Children.empty() && "AND iterator should have at least one child."); // Establish invariants. @@ -193,7 +193,7 @@ /// soon as all of its children are exhausted. class OrIterator : public Iterator { public: - OrIterator(std::vector> AllChildren) + explicit OrIterator(std::vector> AllChildren) : Children(std::move(AllChildren)) { assert(Children.size() > 0 && "OR iterator must have at least one child."); } @@ -279,7 +279,7 @@ /// in O(1). class TrueIterator : public Iterator { public: - TrueIterator(DocID Size) : Size(Size) {} + explicit TrueIterator(DocID Size) : Size(Size) {} bool reachedEnd() const override { return Index >= Size; }