Skip to content

Commit

Permalink
Add default constructurs to filter_iterator_impl and `filter_iterat…
Browse files Browse the repository at this point in the history
…or_impl`.

Bases of `reverse_iterator` must be default-constructible. This is enforced when using `libstdc++-12` plus C++20.

Differential Revision: https://reviews.llvm.org/D141587
  • Loading branch information
jensmassberg committed Jan 13, 2023
1 parent 45cd0e4 commit 0995b54
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions llvm/include/llvm/ADT/STLExtras.h
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,8 @@ class filter_iterator_base
BaseT::operator++();
}

filter_iterator_base() = default;

// Construct the iterator. The begin iterator needs to know where the end
// is, so that it can properly stop when it gets there. The end iterator only
// needs the predicate to support bidirectional iteration.
Expand Down Expand Up @@ -559,6 +561,8 @@ template <typename WrappedIteratorT, typename PredicateT,
class filter_iterator_impl
: public filter_iterator_base<WrappedIteratorT, PredicateT, IterTag> {
public:
filter_iterator_impl() = default;

filter_iterator_impl(WrappedIteratorT Begin, WrappedIteratorT End,
PredicateT Pred)
: filter_iterator_impl::filter_iterator_base(Begin, End, Pred) {}
Expand All @@ -580,6 +584,8 @@ class filter_iterator_impl<WrappedIteratorT, PredicateT,
public:
using BaseT::operator--;

filter_iterator_impl() = default;

filter_iterator_impl(WrappedIteratorT Begin, WrappedIteratorT End,
PredicateT Pred)
: BaseT(Begin, End, Pred) {}
Expand Down

0 comments on commit 0995b54

Please sign in to comment.