[libcxx-commits] [libcxx] [libc++][test] Fix invalid low-level const conversion in limited_allocator (PR #118189)

Peng Liu via libcxx-commits libcxx-commits at lists.llvm.org
Fri Dec 6 06:08:08 PST 2024


================
@@ -467,7 +467,10 @@ class limited_allocator {
   TEST_CONSTEXPR_CXX20 pointer allocate(size_type n) { return handle_->template allocate<T>(n); }
   TEST_CONSTEXPR_CXX20 void deallocate(pointer p, size_type n) { handle_->template deallocate<T>(p, n); }
   TEST_CONSTEXPR size_type max_size() const { return N; }
-  TEST_CONSTEXPR BuffT* getHandle() const { return handle_.get(); }
+
+  // In C++11, constexpr non-static member functions are implicitly const, but this is no longer the case since C++14.
----------------
winner245 wrote:

I was working on a draft PR #118141 adding exception tests for other vector operations, which heavily used the `limited_allocator` class and somehow triggered the usage of `operator=`. 

https://github.com/llvm/llvm-project/pull/118189


More information about the libcxx-commits mailing list