Skip to content

Commit 3e55daf

Browse files
winner245ldionne
authored andcommitted
Fix invalid low-level const conversion
1 parent 10ef00f commit 3e55daf

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
@@ -477,7 +477,10 @@ 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+
481+
// In C++11, constexpr non-static member functions are implicitly const, but this is no longer the case since C++14.
482+
TEST_CONSTEXPR_CXX14 BuffT* getHandle() { return handle_.get(); }
483+
TEST_CONSTEXPR const BuffT* getHandle() const { return handle_.get(); }
481484
};
482485

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

0 commit comments

Comments
 (0)