[libc++] Qualifies size_t.

This has been done using the following command

  find libcxx/test -type f -exec perl -pi -e 's|^([^/]+?)((?<!::)size_t)|\1std::\2|' \{} \;

And manually removed some false positives in std/depr/depr.c.headers.

The `std` module doesn't export `::size_t`, this is a preparation for that module.

Reviewed By: ldionne, #libc, EricWF, philnik

Differential Revision: https://reviews.llvm.org/D146088
This commit is contained in:
Mark de Wever
2023-03-14 21:27:03 +01:00
parent 00fdd2cb6c
commit fb855eb941
465 changed files with 1636 additions and 1619 deletions

View File

@@ -23,7 +23,7 @@ struct throwing_alloc
{
typedef T value_type;
throwing_alloc(const throwing_alloc&);
T *allocate(size_t);
T *allocate(std::size_t);
~throwing_alloc() noexcept(false);
};

View File

@@ -81,7 +81,7 @@ TEST_CONSTEXPR_CXX20 bool test() {
}
{ // Testing (4) w/o allocator
const std::string sin("abc");
std::basic_string s(sin, (size_t)1);
std::basic_string s(sin, (std::size_t)1);
ASSERT_SAME_TYPE(decltype(s), std::string);
assert(s == "bc");
@@ -97,7 +97,7 @@ TEST_CONSTEXPR_CXX20 bool test() {
}
{ // Testing (4) w/ allocator
const std::string sin("abc");
std::basic_string s(sin, (size_t)1, std::allocator<char>{});
std::basic_string s(sin, (std::size_t)1, std::allocator<char>{});
ASSERT_SAME_TYPE(decltype(s), std::string);
assert(s == "bc");
@@ -113,7 +113,7 @@ TEST_CONSTEXPR_CXX20 bool test() {
}
{ // Testing (5) w/o allocator
const std::string sin("abc");
std::basic_string s(sin, (size_t)1, (size_t)3);
std::basic_string s(sin, (std::size_t)1, (size_t)3);
ASSERT_SAME_TYPE(decltype(s), std::string);
assert(s == "bc");
@@ -129,7 +129,7 @@ TEST_CONSTEXPR_CXX20 bool test() {
}
{ // Testing (5) w/ allocator
const std::string sin("abc");
std::basic_string s(sin, (size_t)1, (size_t)3, std::allocator<char>{});
std::basic_string s(sin, (std::size_t)1, (size_t)3, std::allocator<char>{});
ASSERT_SAME_TYPE(decltype(s), std::string);
assert(s == "bc");
@@ -144,18 +144,18 @@ TEST_CONSTEXPR_CXX20 bool test() {
#endif
}
{ // Testing (6) w/o allocator
std::basic_string s("abc", (size_t)2);
std::basic_string s("abc", (std::size_t)2);
ASSERT_SAME_TYPE(decltype(s), std::string);
assert(s == "ab");
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
std::basic_string w(L"abcdef", (size_t)3);
std::basic_string w(L"abcdef", (std::size_t)3);
ASSERT_SAME_TYPE(decltype(w), std::wstring);
assert(w == L"abc");
#endif
}
{ // Testing (6) w/ allocator
std::basic_string s("abc", (size_t)2, std::allocator<char>{});
std::basic_string s("abc", (std::size_t)2, std::allocator<char>{});
ASSERT_SAME_TYPE(decltype(s), std::string);
assert(s == "ab");

View File

@@ -31,7 +31,7 @@ struct some_alloc
{
typedef T value_type;
some_alloc(const some_alloc&);
T *allocate(size_t);
T *allocate(std::size_t);
};
template <class T>
@@ -41,7 +41,7 @@ struct some_alloc2
some_alloc2() {}
some_alloc2(const some_alloc2&);
T *allocate(size_t);
T *allocate(std::size_t);
void deallocate(void*, unsigned) {}
typedef std::false_type propagate_on_container_move_assignment;
@@ -55,7 +55,7 @@ struct some_alloc3
some_alloc3() {}
some_alloc3(const some_alloc3&);
T *allocate(size_t);
T *allocate(std::size_t);
void deallocate(void*, unsigned) {}
typedef std::false_type propagate_on_container_move_assignment;