diff --git a/libcxx/test/support/test_allocator.h b/libcxx/test/support/test_allocator.h index dcd15332ca304f3..49dad642184da31 100644 --- a/libcxx/test/support/test_allocator.h +++ b/libcxx/test/support/test_allocator.h @@ -467,7 +467,10 @@ class limited_allocator { TEST_CONSTEXPR_CXX20 pointer allocate(size_type n) { return handle_->template allocate(n); } TEST_CONSTEXPR_CXX20 void deallocate(pointer p, size_type n) { handle_->template deallocate(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