Fix bug in test_allocator<void> that used the wrong value to represent object state
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@246270 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4f241823a2
commit
5ec04a92d2
@ -171,13 +171,13 @@ public:
|
|||||||
|
|
||||||
template <class U> struct rebind {typedef test_allocator<U> other;};
|
template <class U> struct rebind {typedef test_allocator<U> other;};
|
||||||
|
|
||||||
test_allocator() throw() : data_(-1) {}
|
test_allocator() throw() : data_(0) {}
|
||||||
explicit test_allocator(int i) throw() : data_(i) {}
|
explicit test_allocator(int i) throw() : data_(i) {}
|
||||||
test_allocator(const test_allocator& a) throw()
|
test_allocator(const test_allocator& a) throw()
|
||||||
: data_(a.data_) {}
|
: data_(a.data_) {}
|
||||||
template <class U> test_allocator(const test_allocator<U>& a) throw()
|
template <class U> test_allocator(const test_allocator<U>& a) throw()
|
||||||
: data_(a.data_) {}
|
: data_(a.data_) {}
|
||||||
~test_allocator() throw() {data_ = 0;}
|
~test_allocator() throw() {data_ = -1;}
|
||||||
|
|
||||||
friend bool operator==(const test_allocator& x, const test_allocator& y)
|
friend bool operator==(const test_allocator& x, const test_allocator& y)
|
||||||
{return x.data_ == y.data_;}
|
{return x.data_ == y.data_;}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user