Skip to content

Commit eacdbc2

Browse files
authored
[libc++][test] Fix invalid const conversion in limited_allocator (#118189)
This patch fixes a const-qualification on the return type of a method of `limited_allocator`, which is widely used for testing allocator-aware containers.
1 parent e3284d8 commit eacdbc2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libcxx/test/support/test_allocator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ class limited_allocator {
477477
TEST_CONSTEXPR_CXX20 pointer allocate(size_type n) { return handle_->template allocate<T>(n); }
478478
TEST_CONSTEXPR_CXX20 void deallocate(pointer p, size_type n) { handle_->template deallocate<T>(p, n); }
479479
TEST_CONSTEXPR size_type max_size() const { return N; }
480-
TEST_CONSTEXPR BuffT* getHandle() const { return handle_.get(); }
480+
TEST_CONSTEXPR const BuffT* getHandle() const { return handle_.get(); }
481481
};
482482

483483
template <class T, class U, std::size_t N>

0 commit comments

Comments
 (0)