Skip to content

Commit 5071d8a

Browse files
[libc++][test] size_type issues with MinSequenceContainer and...
... `min_allocator`
1 parent 4d7192a commit 5071d8a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

libcxx/test/support/MinSequenceContainer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct MinSequenceContainer {
3131
const_iterator cbegin() const { return const_iterator(data_.data()); }
3232
iterator end() { return begin() + size(); }
3333
const_iterator end() const { return begin() + size(); }
34-
size_type size() const { return data_.size(); }
34+
size_type size() const { return static_cast<size_type>(data_.size()); }
3535
bool empty() const { return data_.empty(); }
3636

3737
void clear() { data_.clear(); }

libcxx/test/support/min_allocator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,12 +394,12 @@ class min_allocator
394394
template <class U>
395395
TEST_CONSTEXPR_CXX20 min_allocator(min_allocator<U>) {}
396396

397-
TEST_CONSTEXPR_CXX20 pointer allocate(std::ptrdiff_t n)
397+
TEST_CONSTEXPR_CXX20 pointer allocate(std::size_t n)
398398
{
399399
return pointer(std::allocator<T>().allocate(n));
400400
}
401401

402-
TEST_CONSTEXPR_CXX20 void deallocate(pointer p, std::ptrdiff_t n)
402+
TEST_CONSTEXPR_CXX20 void deallocate(pointer p, std::size_t n)
403403
{
404404
std::allocator<T>().deallocate(p.ptr_, n);
405405
}

0 commit comments

Comments
 (0)