diff --git a/libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/allocator_propagation.pass.cpp b/libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/allocator_propagation.pass.cpp --- a/libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/allocator_propagation.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.nonmembers/string_op+/allocator_propagation.pass.cpp @@ -24,10 +24,10 @@ using value_type = T; constexpr explicit soccc_allocator(int* soccc_count_, int self_coccc_count_ = 0) - : soccc_count(soccc_count_), self_soccc_count(self_coccc_count_) {} + : soccc_count(soccc_count_), self_soccc_count(self_coccc_count_) {} template - constexpr soccc_allocator(const soccc_allocator& a) : soccc_count(a.soccc_count) {} + constexpr soccc_allocator(const soccc_allocator& a) : soccc_count(a.get_soccc()) {} constexpr T* allocate(std::size_t n) { return std::allocator().allocate(n); } constexpr void deallocate(T* p, std::size_t s) { std::allocator().deallocate(p, s); } @@ -37,12 +37,17 @@ return soccc_allocator(soccc_count, self_soccc_count + 1); } - constexpr auto get_soccc() { return soccc_count; } - constexpr auto get_self_soccc() { return self_soccc_count; } + constexpr auto get_soccc() const { return soccc_count; } + constexpr auto get_self_soccc() const { return self_soccc_count; } typedef std::true_type propagate_on_container_copy_assignment; typedef std::true_type propagate_on_container_move_assignment; typedef std::true_type propagate_on_container_swap; + + template + constexpr bool operator==(const soccc_allocator& that) const { + return soccc_count == that.get_soccc(); + } }; template