1818
1919#include " test_macros.h"
2020
21- static std::size_t allocated_;
22- static std::size_t deallocated_;
21+ static std::uint64_t allocated_;
22+ static std::uint64_t deallocated_;
2323
2424template <class T , class Sz >
2525struct test_alloc {
@@ -42,12 +42,12 @@ struct test_alloc {
4242 TEST_CONSTEXPR test_alloc (const test_alloc<U, Sz>&) TEST_NOEXCEPT {}
4343
4444 pointer allocate (size_type n, const void * = nullptr ) {
45- allocated_ += static_cast <std:: size_t >(n) ;
45+ allocated_ += n ;
4646 return std::allocator<value_type>().allocate (static_cast <std::size_t >(n));
4747 }
4848
4949 void deallocate (pointer p, size_type s) {
50- deallocated_ += static_cast <std:: size_t >(s) ;
50+ deallocated_ += s ;
5151 std::allocator<value_type>().deallocate (p, static_cast <std::size_t >(s));
5252 }
5353
@@ -66,9 +66,10 @@ struct test_alloc {
6666
6767template <class Sz >
6868void test () {
69- for (int i = 1 ; i < 1000 ; ++i) {
69+ for (unsigned int i = 1 ; i < 1000 ; ++i) {
7070 {
71- TEST_MAYBE_UNUSED std::basic_string<char , std::char_traits<char >, test_alloc<char , Sz> > s (i, ' t' );
71+ std::basic_string<char , std::char_traits<char >, test_alloc<char , Sz> > s (i, ' t' );
72+ (void )s;
7273 }
7374 assert (allocated_ == deallocated_);
7475 }
0 commit comments