[libcxx-commits] [libcxx] 85561dd - [libc++] Fix bounded iterator hardening mode in C++03 mode

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Aug 26 14:17:54 PDT 2024


Author: Louis Dionne
Date: 2024-08-26T17:17:27-04:00
New Revision: 85561dd59485350a4f09ea5cb049b38f69b1e470

URL: https://github.com/llvm/llvm-project/commit/85561dd59485350a4f09ea5cb049b38f69b1e470
DIFF: https://github.com/llvm/llvm-project/commit/85561dd59485350a4f09ea5cb049b38f69b1e470.diff

LOG: [libc++] Fix bounded iterator hardening mode in C++03 mode

Added: 
    

Modified: 
    libcxx/include/string
    libcxx/include/vector

Removed: 
    


################################################################################
diff  --git a/libcxx/include/string b/libcxx/include/string
index cdc1afedbdf52f..05d42afb7c9c3d 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -827,8 +827,8 @@ public:
   // Users might provide custom allocators, and prior to C++20 we have no existing way to detect whether the allocator's
   // pointer type is contiguous (though it has to be by the Standard). Using the wrapper type ensures the iterator is
   // considered contiguous.
-  typedef __bounded_iter<__wrap_iter<pointer>> iterator;
-  typedef __bounded_iter<__wrap_iter<const_pointer>> const_iterator;
+  typedef __bounded_iter<__wrap_iter<pointer> > iterator;
+  typedef __bounded_iter<__wrap_iter<const_pointer> > const_iterator;
 #else
   typedef __wrap_iter<pointer> iterator;
   typedef __wrap_iter<const_pointer> const_iterator;

diff  --git a/libcxx/include/vector b/libcxx/include/vector
index a858f458f44308..81aab9407714cc 100644
--- a/libcxx/include/vector
+++ b/libcxx/include/vector
@@ -404,8 +404,8 @@ public:
   // Users might provide custom allocators, and prior to C++20 we have no existing way to detect whether the allocator's
   // pointer type is contiguous (though it has to be by the Standard). Using the wrapper type ensures the iterator is
   // considered contiguous.
-  typedef __bounded_iter<__wrap_iter<pointer>> iterator;
-  typedef __bounded_iter<__wrap_iter<const_pointer>> const_iterator;
+  typedef __bounded_iter<__wrap_iter<pointer> > iterator;
+  typedef __bounded_iter<__wrap_iter<const_pointer> > const_iterator;
 #else
   typedef __wrap_iter<pointer> iterator;
   typedef __wrap_iter<const_pointer> const_iterator;


        


More information about the libcxx-commits mailing list