Skip to content

Commit

Permalink
Fix invalid low-level const conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
winner245 committed Dec 7, 2024
1 parent aebd338 commit 043557a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libcxx/test/support/test_allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
TEST_CONSTEXPR_CXX14 BuffT* getHandle() { return handle_.get(); }
TEST_CONSTEXPR const BuffT* getHandle() const { return handle_.get(); }
};

template <class T, class U, std::size_t N>
Expand Down

0 comments on commit 043557a

Please sign in to comment.