[PATCH] D141587: Add default constructurs to `filter_iterator_impl` and `filter_iterator_impl`.

Jens Massberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 12 02:45:24 PST 2023


massberg created this revision.
massberg added a reviewer: ilya-biryukov.
Herald added a project: All.
massberg requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141587

Files:
  llvm/include/llvm/ADT/STLExtras.h


Index: llvm/include/llvm/ADT/STLExtras.h
===================================================================
--- llvm/include/llvm/ADT/STLExtras.h
+++ llvm/include/llvm/ADT/STLExtras.h
@@ -524,6 +524,8 @@
       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 @@
 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 @@
 public:
   using BaseT::operator--;
 
+  filter_iterator_impl() = default;
+
   filter_iterator_impl(WrappedIteratorT Begin, WrappedIteratorT End,
                        PredicateT Pred)
       : BaseT(Begin, End, Pred) {}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141587.488564.patch
Type: text/x-patch
Size: 1100 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230112/f6f9f980/attachment.bin>


More information about the llvm-commits mailing list