Skip to content

Commit 1d5f220

Browse files
committed
Fix invalid low-level const conversion
1 parent 4a07433 commit 1d5f220

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libcxx/test/support/test_allocator.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,10 @@ class limited_allocator {
467467
TEST_CONSTEXPR_CXX20 pointer allocate(size_type n) { return handle_->template allocate<T>(n); }
468468
TEST_CONSTEXPR_CXX20 void deallocate(pointer p, size_type n) { handle_->template deallocate<T>(p, n); }
469469
TEST_CONSTEXPR size_type max_size() const { return N; }
470-
TEST_CONSTEXPR BuffT* getHandle() const { return handle_.get(); }
470+
471+
// In C++11, constexpr non-static member functions are implicitly const, but this is no longer the case since C++14.
472+
TEST_CONSTEXPR_CXX14 BuffT* getHandle() { return handle_.get(); }
473+
TEST_CONSTEXPR const BuffT* getHandle() const { return handle_.get(); }
471474
};
472475

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

0 commit comments

Comments
 (0)