[llvm] 1882a4e - [ADT] fix postfix filter_iterator_impl::operator++

Alex Brachet via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 7 08:12:16 PDT 2023


Author: Alex Brachet
Date: 2023-07-07T15:12:03Z
New Revision: 1882a4ee69b3cc2202d8d7d7b6465475f6d19886

URL: https://github.com/llvm/llvm-project/commit/1882a4ee69b3cc2202d8d7d7b6465475f6d19886
DIFF: https://github.com/llvm/llvm-project/commit/1882a4ee69b3cc2202d8d7d7b6465475f6d19886.diff

LOG: [ADT] fix postfix filter_iterator_impl::operator++

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 6fbe2ba54fedf5..dcf3e160804715 100644
--- a/llvm/include/llvm/ADT/STLExtras.h
+++ b/llvm/include/llvm/ADT/STLExtras.h
@@ -541,8 +541,9 @@ class filter_iterator_impl<WrappedIteratorT, PredicateT,
   }
 
   filter_iterator_impl &operator++(int) {
+    filter_iterator_impl &old = *this;
     BaseT::operator++();
-    return *this;
+    return old;
   }
 
   filter_iterator_impl &operator--() {


        


More information about the llvm-commits mailing list