[llvm] 0995b54 - Add default constructurs to `filter_iterator_impl` and `filter_iterator_impl`.
Jens Massberg via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 13 07:45:13 PST 2023
Author: Jens Massberg
Date: 2023-01-13T16:44:48+01:00
New Revision: 0995b545ecc8214ddcfd68ede11503fc029cacd4
URL: https://github.com/llvm/llvm-project/commit/0995b545ecc8214ddcfd68ede11503fc029cacd4
DIFF: https://github.com/llvm/llvm-project/commit/0995b545ecc8214ddcfd68ede11503fc029cacd4.diff
LOG: Add default constructurs to `filter_iterator_impl` and `filter_iterator_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
Added:
Modified:
llvm/include/llvm/ADT/STLExtras.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h
index 1354268bc2822..be8800cc46450 100644
--- a/llvm/include/llvm/ADT/STLExtras.h
+++ b/llvm/include/llvm/ADT/STLExtras.h
@@ -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.
@@ -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) {}
@@ -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) {}
More information about the llvm-commits
mailing list