[libcxx-commits] [libcxx] fb855eb - [libc++] Qualifies size_t.

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 21 09:41:45 PDT 2023


Author: Mark de Wever
Date: 2023-03-21T17:41:36+01:00
New Revision: fb855eb941b6d740cc6560297d0b4d3201dcaf9f

URL: https://github.com/llvm/llvm-project/commit/fb855eb941b6d740cc6560297d0b4d3201dcaf9f
DIFF: https://github.com/llvm/llvm-project/commit/fb855eb941b6d740cc6560297d0b4d3201dcaf9f.diff

LOG: [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

Added: 
    

Modified: 
    libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_nontrivial.pass.cpp
    libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_trivial.pass.cpp
    libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_unwrap_reverse.pass.cpp
    libcxx/test/libcxx/algorithms/debug_less.pass.cpp
    libcxx/test/libcxx/algorithms/half_positive.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/exception_safety_exceptions_disabled.pass.cpp
    libcxx/test/libcxx/containers/unord/next_pow2.pass.cpp
    libcxx/test/libcxx/containers/unord/next_prime.pass.cpp
    libcxx/test/libcxx/containers/unord/non_const_comparator.verify.cpp
    libcxx/test/libcxx/containers/unord/unord.set/missing_hash_specialization.fail.cpp
    libcxx/test/libcxx/debug/containers.multithread.pass.cpp
    libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.pass.cpp
    libcxx/test/libcxx/fuzzing/nth_element.pass.cpp
    libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp
    libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.pass.cpp
    libcxx/test/libcxx/numerics/numeric.ops/midpoint.integer.pass.cpp
    libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/no_unique_address.compile.pass.cpp
    libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/types.h
    libcxx/test/libcxx/strings/basic.string/alignof.compile.pass.cpp
    libcxx/test/libcxx/strings/basic.string/sizeof.compile.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.capacity/max_size.pass.cpp
    libcxx/test/libcxx/type_traits/is_specialization.verify.cpp
    libcxx/test/libcxx/utilities/format/format.string/format.string.std/extended_grapheme_cluster.h
    libcxx/test/libcxx/utilities/format/format.string/format.string.std/extended_grapheme_cluster.pass.cpp
    libcxx/test/libcxx/utilities/function.objects/unord.hash/murmur2_or_cityhash_ubsan_unsigned_overflow_ignored.pass.cpp
    libcxx/test/libcxx/utilities/intseq/for_each_index_sequence.pass.cpp
    libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_variant_overloads_impl.sh.cpp
    libcxx/test/libcxx/utilities/variant/variant.variant/variant_size.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy_n.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.fill/fill_n.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate_n.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_copy.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_point.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_stable_partition.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.random.sample/ranges_sample.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/ranges_shuffle.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.reverse/ranges.reverse.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/ranges.rotate_copy.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/ranges_rotate.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate_copy.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp
    libcxx/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/ranges.adjacent_find.pass.cpp
    libcxx/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap_until.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/ranges_make_heap.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/ranges_pop_heap.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/ranges_push_heap.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/ranges_sort_heap.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.nth.element/ranges_nth_element.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.permutation.generators/ranges.next_permutation.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.permutation.generators/ranges.prev_permutation.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/ranges_partial_sort_copy.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort/ranges_partial_sort.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/ranges.sort.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/ranges.stable.sort.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/sortable_helpers.h
    libcxx/test/std/algorithms/ranges_robust_against_dangling.pass.cpp
    libcxx/test/std/algorithms/ranges_robust_against_omitting_invoke.pass.cpp
    libcxx/test/std/algorithms/robust_against_adl_on_new.pass.cpp
    libcxx/test/std/algorithms/robust_against_proxy_iterators_lifetime_bugs.pass.cpp
    libcxx/test/std/atomics/stdatomic.h.syn/types.compile.pass.cpp
    libcxx/test/std/atomics/types.pass.cpp
    libcxx/test/std/containers/associative/map/map.access/max_size.pass.cpp
    libcxx/test/std/containers/associative/map/map.cons/copy_assign.pass.cpp
    libcxx/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp
    libcxx/test/std/containers/associative/map/map.erasure/erase_if.pass.cpp
    libcxx/test/std/containers/associative/map/map.modifiers/extract_iterator.pass.cpp
    libcxx/test/std/containers/associative/map/map.modifiers/extract_key.pass.cpp
    libcxx/test/std/containers/associative/map/map.modifiers/insert_node_type_hint.pass.cpp
    libcxx/test/std/containers/associative/multimap/max_size.pass.cpp
    libcxx/test/std/containers/associative/multimap/multimap.cons/move_alloc.pass.cpp
    libcxx/test/std/containers/associative/multimap/multimap.erasure/erase_if.pass.cpp
    libcxx/test/std/containers/associative/multimap/multimap.modifiers/extract_iterator.pass.cpp
    libcxx/test/std/containers/associative/multimap/multimap.modifiers/extract_key.pass.cpp
    libcxx/test/std/containers/associative/multimap/multimap.modifiers/insert_node_type_hint.pass.cpp
    libcxx/test/std/containers/associative/multiset/extract_iterator.pass.cpp
    libcxx/test/std/containers/associative/multiset/extract_key.pass.cpp
    libcxx/test/std/containers/associative/multiset/insert_node_type_hint.pass.cpp
    libcxx/test/std/containers/associative/multiset/max_size.pass.cpp
    libcxx/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp
    libcxx/test/std/containers/associative/multiset/multiset.erasure/erase_if.pass.cpp
    libcxx/test/std/containers/associative/set/extract_iterator.pass.cpp
    libcxx/test/std/containers/associative/set/extract_key.pass.cpp
    libcxx/test/std/containers/associative/set/insert_node_type_hint.pass.cpp
    libcxx/test/std/containers/associative/set/max_size.pass.cpp
    libcxx/test/std/containers/associative/set/set.cons/move_alloc.pass.cpp
    libcxx/test/std/containers/associative/set/set.erasure/erase_if.pass.cpp
    libcxx/test/std/containers/check_consecutive.h
    libcxx/test/std/containers/sequences/array/contiguous.pass.cpp
    libcxx/test/std/containers/sequences/array/size_and_alignment.pass.cpp
    libcxx/test/std/containers/sequences/deque/abi.compile.pass.cpp
    libcxx/test/std/containers/sequences/deque/deque.capacity/max_size.pass.cpp
    libcxx/test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/deque/deque.erasure/erase.pass.cpp
    libcxx/test/std/containers/sequences/deque/deque.erasure/erase_if.pass.cpp
    libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.invalidation.pass.cpp
    libcxx/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/forwardlist.erasure/erase.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/forwardlist.erasure/erase_if.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_lvalue.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_lvalue_pred.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_rvalue.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_rvalue_pred.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/remove_if.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/unique_pred.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/max_size.pass.cpp
    libcxx/test/std/containers/sequences/list/list.capacity/max_size.pass.cpp
    libcxx/test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/list/list.erasure/erase.pass.cpp
    libcxx/test/std/containers/sequences/list/list.erasure/erase_if.pass.cpp
    libcxx/test/std/containers/sequences/list/list.ops/remove_if.pass.cpp
    libcxx/test/std/containers/sequences/list/list.ops/unique_pred.pass.cpp
    libcxx/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/insert_iter_iter_iter.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/insert_iter_size_value.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/insert_iter_value.pass.cpp
    libcxx/test/std/containers/sequences/vector/contiguous.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.capacity/max_size.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.capacity/reserve.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.cons/assign_iter_iter.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.cons/default_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.cons/move_assign_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.cons/move_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.erasure/erase.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.erasure/erase_if.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_lvalue.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.special/swap_noexcept.compile.pass.cpp
    libcxx/test/std/containers/unord/unord.map/bucket.pass.cpp
    libcxx/test/std/containers/unord/unord.map/compare.pass.cpp
    libcxx/test/std/containers/unord/unord.map/erase_if.pass.cpp
    libcxx/test/std/containers/unord/unord.map/max_size.pass.cpp
    libcxx/test/std/containers/unord/unord.map/rehash.pass.cpp
    libcxx/test/std/containers/unord/unord.map/reserve.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/erase_const_iter.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/extract_iterator.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/extract_key.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_node_type_hint.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_or_assign.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/merge.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/try.emplace.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/bucket.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/erase_if.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/max_size.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/rehash.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/reserve.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_const_iter.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/extract_iterator.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/extract_key.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_node_type_hint.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/merge.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/bucket.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/erase_const_iter.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/erase_if.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/extract_iterator.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/extract_key.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/insert_node_type_hint.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/max_size.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/merge.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/rehash.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/reserve.pass.cpp
    libcxx/test/std/containers/unord/unord.set/bucket.pass.cpp
    libcxx/test/std/containers/unord/unord.set/erase_const_iter.pass.cpp
    libcxx/test/std/containers/unord/unord.set/erase_if.pass.cpp
    libcxx/test/std/containers/unord/unord.set/extract_iterator.pass.cpp
    libcxx/test/std/containers/unord/unord.set/extract_key.pass.cpp
    libcxx/test/std/containers/unord/unord.set/insert_node_type_hint.pass.cpp
    libcxx/test/std/containers/unord/unord.set/max_size.pass.cpp
    libcxx/test/std/containers/unord/unord.set/merge.pass.cpp
    libcxx/test/std/containers/unord/unord.set/rehash.pass.cpp
    libcxx/test/std/containers/unord/unord.set/reserve.pass.cpp
    libcxx/test/std/containers/views/views.span/span.cons/assign.pass.cpp
    libcxx/test/std/containers/views/views.span/span.cons/iterator_len.pass.cpp
    libcxx/test/std/containers/views/views.span/span.cons/iterator_len.verify.cpp
    libcxx/test/std/containers/views/views.span/span.cons/iterator_sentinel.pass.cpp
    libcxx/test/std/containers/views/views.span/span.cons/iterator_sentinel.verify.cpp
    libcxx/test/std/containers/views/views.span/span.cons/range.pass.cpp
    libcxx/test/std/containers/views/views.span/span.cons/span.fail.cpp
    libcxx/test/std/containers/views/views.span/span.elem/op_idx.pass.cpp
    libcxx/test/std/containers/views/views.span/span.iterators/end.pass.cpp
    libcxx/test/std/containers/views/views.span/span.iterators/rend.pass.cpp
    libcxx/test/std/containers/views/views.span/span.objectrep/as_writable_bytes.verify.cpp
    libcxx/test/std/containers/views/views.span/span.obs/size.pass.cpp
    libcxx/test/std/containers/views/views.span/span.obs/size_bytes.pass.cpp
    libcxx/test/std/containers/views/views.span/span.sub/first.pass.cpp
    libcxx/test/std/containers/views/views.span/span.sub/last.pass.cpp
    libcxx/test/std/containers/views/views.span/span.sub/subspan.pass.cpp
    libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/custom_alloc.pass.cpp
    libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/allocate.pass.cpp
    libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/deallocate.pass.cpp
    libcxx/test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp
    libcxx/test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp
    libcxx/test/std/experimental/simd/simd.cons/broadcast.pass.cpp
    libcxx/test/std/experimental/simd/simd.cons/generator.pass.cpp
    libcxx/test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/hash.pass.cpp
    libcxx/test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp
    libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp
    libcxx/test/std/iterators/iterator.container/data.pass.cpp
    libcxx/test/std/iterators/iterator.container/empty.pass.cpp
    libcxx/test/std/iterators/iterator.container/size.pass.cpp
    libcxx/test/std/iterators/iterator.container/ssize.pass.cpp
    libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.hash/hash.pass.cpp
    libcxx/test/std/language.support/support.runtime/cstdlib.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/classic_table.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/table_size.pass.cpp
    libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_length.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/converted.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/from_bytes.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/to_bytes.pass.cpp
    libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.fail.cpp
    libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.pass.cpp
    libcxx/test/std/numerics/bit/bit.pow.two/bit_floor.pass.cpp
    libcxx/test/std/numerics/bit/bit.pow.two/bit_width.pass.cpp
    libcxx/test/std/numerics/bit/bit.pow.two/has_single_bit.pass.cpp
    libcxx/test/std/numerics/bit/bitops.count/countl_one.pass.cpp
    libcxx/test/std/numerics/bit/bitops.count/countl_zero.pass.cpp
    libcxx/test/std/numerics/bit/bitops.count/countr_one.pass.cpp
    libcxx/test/std/numerics/bit/bitops.count/countr_zero.pass.cpp
    libcxx/test/std/numerics/bit/bitops.count/popcount.pass.cpp
    libcxx/test/std/numerics/bit/bitops.rot/rotl.pass.cpp
    libcxx/test/std/numerics/bit/bitops.rot/rotr.pass.cpp
    libcxx/test/std/numerics/c.math/cmath.pass.cpp
    libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/deduct.pass.cpp
    libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/size.pass.cpp
    libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp
    libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp
    libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp
    libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp
    libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp
    libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.integer.pass.cpp
    libcxx/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp
    libcxx/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp
    libcxx/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
    libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/eval.pass.cpp
    libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/eval_param.pass.cpp
    libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/get_param.pass.cpp
    libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/io.pass.cpp
    libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/max.pass.cpp
    libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/min.pass.cpp
    libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/param_assign.pass.cpp
    libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/param_copy.pass.cpp
    libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp
    libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/eval_param.pass.cpp
    libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/get_param.pass.cpp
    libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/io.pass.cpp
    libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/max.pass.cpp
    libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/min.pass.cpp
    libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/param_assign.pass.cpp
    libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/param_copy.pass.cpp
    libcxx/test/std/ranges/range.access/empty.pass.cpp
    libcxx/test/std/ranges/range.access/size.pass.cpp
    libcxx/test/std/ranges/range.access/ssize.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.as.rvalue/size.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.counted/counted.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.drop/adaptor.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.drop/begin.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.elements/iterator/ctor.default.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.elements/iterator/member_types.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.elements/range.concept.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/constraints.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/general.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/increment.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/types.h
    libcxx/test/std/ranges/range.adaptors/range.reverse/size.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.split/general.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.take/begin.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.transform/types.h
    libcxx/test/std/ranges/range.factories/range.single.view/size.pass.cpp
    libcxx/test/std/ranges/range.utility/range.subrange/ctor.begin_end_size.pass.cpp
    libcxx/test/std/ranges/range.utility/range.subrange/get.pass.cpp
    libcxx/test/std/ranges/range.utility/range.subrange/types.h
    libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.match/awk.locale.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.match/basic.locale.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.match/ecma.locale.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.match/extended.locale.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.search/awk.locale.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.search/basic.locale.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.search/ecma.locale.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.search/extended.locale.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.search/grep.pass.cpp
    libcxx/test/std/strings/basic.string.hash/char_type_hash.fail.cpp
    libcxx/test/std/strings/basic.string.hash/enabled_hashes.pass.cpp
    libcxx/test/std/strings/basic.string/string.capacity/max_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.capacity/resize_and_overwrite.pass.cpp
    libcxx/test/std/strings/basic.string/string.capacity/shrink_to_fit.explicit_instantiation.sh.cpp
    libcxx/test/std/strings/basic.string/string.cons/dtor.pass.cpp
    libcxx/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp
    libcxx/test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp
    libcxx/test/std/strings/basic.string/string.nonmembers/string.cmp/comparison.pass.cpp
    libcxx/test/std/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp
    libcxx/test/std/strings/basic.string/string.require/contiguous.pass.cpp
    libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp
    libcxx/test/std/strings/string.conversions/stod.pass.cpp
    libcxx/test/std/strings/string.conversions/stof.pass.cpp
    libcxx/test/std/strings/string.conversions/stoi.pass.cpp
    libcxx/test/std/strings/string.conversions/stol.pass.cpp
    libcxx/test/std/strings/string.conversions/stold.pass.cpp
    libcxx/test/std/strings/string.conversions/stoll.pass.cpp
    libcxx/test/std/strings/string.conversions/stoul.pass.cpp
    libcxx/test/std/strings/string.conversions/stoull.pass.cpp
    libcxx/test/std/strings/string.view/string.view.access/at.pass.cpp
    libcxx/test/std/strings/string.view/string.view.access/back.pass.cpp
    libcxx/test/std/strings/string.view/string.view.access/data.pass.cpp
    libcxx/test/std/strings/string.view/string.view.access/front.pass.cpp
    libcxx/test/std/strings/string.view/string.view.access/index.pass.cpp
    libcxx/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp
    libcxx/test/std/strings/string.view/string.view.comparison/common_type_specialization.pass.cpp
    libcxx/test/std/strings/string.view/string.view.comparison/comparison.pass.cpp
    libcxx/test/std/strings/string.view/string.view.comparison/comparison.verify.cpp
    libcxx/test/std/strings/string.view/string.view.cons/from_literal.pass.cpp
    libcxx/test/std/strings/string.view/string.view.cons/from_ptr_len.pass.cpp
    libcxx/test/std/strings/string.view/string.view.cons/from_range.pass.cpp
    libcxx/test/std/strings/string.view/string.view.hash/char_type.hash.fail.cpp
    libcxx/test/std/strings/string.view/string.view.hash/enabled_hashes.pass.cpp
    libcxx/test/std/strings/string.view/string.view.iterators/rbegin.pass.cpp
    libcxx/test/std/strings/string.view/string.view.modifiers/remove_prefix.pass.cpp
    libcxx/test/std/strings/string.view/string.view.modifiers/remove_suffix.pass.cpp
    libcxx/test/std/strings/string.view/string.view.modifiers/swap.pass.cpp
    libcxx/test/std/strings/string.view/string.view.ops/compare.pointer_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv.pass.cpp
    libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.ops/copy.pass.cpp
    libcxx/test/std/strings/string.view/string.view.ops/substr.pass.cpp
    libcxx/test/std/strings/strings.erasure/erase.pass.cpp
    libcxx/test/std/strings/strings.erasure/erase_if.pass.cpp
    libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp
    libcxx/test/std/utilities/charconv/charconv.msvc/test.hpp
    libcxx/test/std/utilities/format/format.formatter/format.context/format.context/arg.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char_array.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.floating_point.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.pass.cpp
    libcxx/test/std/utilities/format/format.functions/escaped_output.ascii.pass.cpp
    libcxx/test/std/utilities/format/format.functions/escaped_output.unicode.pass.cpp
    libcxx/test/std/utilities/format/format.functions/formatted_size.locale.pass.cpp
    libcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp
    libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp
    libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp
    libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp
    libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp
    libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp
    libcxx/test/std/utilities/function.objects/unord.hash/enum.compile.fail.cpp
    libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp
    libcxx/test/std/utilities/intseq/intseq.general/integer_seq.pass.cpp
    libcxx/test/std/utilities/memory/allocator.traits/allocate_at_least.pass.cpp
    libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp
    libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.constexpr.size.verify.cpp
    libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp
    libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp
    libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate_at_least.pass.cpp
    libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/ranges_uninitialized_copy_n.pass.cpp
    libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.fill.n/ranges_uninitialized_fill_n.pass.cpp
    libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.move/ranges_uninitialized_move_n.pass.cpp
    libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp
    libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared_construct.pass.cpp
    libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared_for_overwrite.pass.cpp
    libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp
    libcxx/test/std/utilities/optional/optional.hash/hash.pass.cpp
    libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique_for_overwrite.pass.cpp
    libcxx/test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp
    libcxx/test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp
    libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/recursion_depth.pass.cpp
    libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.array.pass.cpp
    libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.utility.pass.cpp
    libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.fail.cpp
    libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.pass.cpp
    libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp
    libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate.pass.cpp
    libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_bytes.pass.cpp
    libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_object.pass.cpp
    libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/deallocate.pass.cpp
    libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/new_delete_object.pass.cpp
    libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/tracking_mem_res.h
    libcxx/test/std/utilities/utility/mem.res/mem.res.global/new_delete_resource.pass.cpp
    libcxx/test/std/utilities/utility/mem.res/mem.res.global/null_memory_resource.pass.cpp
    libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_exception_safety.pass.cpp
    libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_in_geometric_progression.pass.cpp
    libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_overaligned_request.pass.cpp
    libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_with_initial_size.pass.cpp
    libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/equality.pass.cpp
    libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/equality.pass.cpp
    libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_overaligned_request.pass.cpp
    libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_reuse_blocks.pass.cpp
    libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_deallocate_matches_allocate.pass.cpp
    libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_overaligned_request.pass.cpp
    libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_reuse_blocks.pass.cpp
    libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_deallocate_matches_allocate.pass.cpp
    libcxx/test/std/utilities/utility/utility.inplace/inplace.pass.cpp
    libcxx/test/std/utilities/variant/variant.get/get_index.pass.cpp
    libcxx/test/std/utilities/variant/variant.hash/hash.pass.cpp
    libcxx/test/std/utilities/variant/variant.helpers/variant_alternative.pass.cpp
    libcxx/test/std/utilities/variant/variant.helpers/variant_size.pass.cpp
    libcxx/test/std/utilities/variant/variant.variant/variant.assign/copy.pass.cpp
    libcxx/test/std/utilities/variant/variant.variant/variant.assign/move.pass.cpp
    libcxx/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp
    libcxx/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp
    libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_args.pass.cpp
    libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_init_list_args.pass.cpp
    libcxx/test/std/utilities/variant/variant.visit/visit.pass.cpp
    libcxx/test/support/MoveOnly.h
    libcxx/test/support/allocators.h
    libcxx/test/support/charconv_test_helpers.h
    libcxx/test/support/constexpr_char_traits.h
    libcxx/test/support/container_test_types.h
    libcxx/test/support/controlled_allocators.h
    libcxx/test/support/counting_predicates.h
    libcxx/test/support/deduction_guides_sfinae_checks.h
    libcxx/test/support/deleter_types.h
    libcxx/test/support/filesystem_test_helper.h
    libcxx/test/support/format.functions.common.h
    libcxx/test/support/make_string.h
    libcxx/test/support/min_allocator.h
    libcxx/test/support/nasty_containers.h
    libcxx/test/support/nasty_string.h
    libcxx/test/support/operator_hijacker.h
    libcxx/test/support/platform_support.h
    libcxx/test/support/poisoned_hash_helper.h
    libcxx/test/support/test.support/test_poisoned_hash_helper.pass.cpp
    libcxx/test/support/test_allocator.h
    libcxx/test/support/test_constexpr_container.h
    libcxx/test/support/test_memory_resource.h
    libcxx/test/support/test_std_memory_resource.h
    libcxx/test/support/uses_alloc_types.h
    libcxx/utils/generate_extended_grapheme_cluster_test.py

Removed: 
    


################################################################################
diff  --git a/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_nontrivial.pass.cpp b/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_nontrivial.pass.cpp
index c26f755768d84..3cbe04f878421 100644
--- a/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_nontrivial.pass.cpp
+++ b/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_nontrivial.pass.cpp
@@ -26,7 +26,7 @@
 // This template is a better match than the actual `builtin_memmove` (it can match the pointer type exactly, without an
 // implicit conversion to `void*`), so it should hijack the call inside `std::copy` and similar algorithms if it's made.
 template <class Dst, class Src>
-constexpr void* __builtin_memmove(Dst*, Src*, size_t) {
+constexpr void* __builtin_memmove(Dst*, Src*, std::size_t) {
   assert(false);
   return nullptr;
 }
@@ -172,7 +172,7 @@ constexpr void test_one(Func func) {
   using To = typename std::iterator_traits<OutIter>::value_type;
 
   {
-    const size_t N = 5;
+    const std::size_t N = 5;
 
     From input[N] = {make<From>(0), make<From>(1), make<From>(2), make<From>(3), make<From>(4)};
     To output[N];
@@ -192,7 +192,7 @@ constexpr void test_one(Func func) {
   }
 
   {
-    const size_t N = 0;
+    const std::size_t N = 0;
 
     From input[1]  = {make<From>(1)};
     To output[1] = {make<To>(2)};
@@ -211,25 +211,25 @@ template <class InIter, template <class> class SentWrapper, class OutIter>
 constexpr void test_copy() {
   // Classic.
   if constexpr (std::same_as<InIter, SentWrapper<InIter>>) {
-    test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t) {
+    test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t) {
       std::copy(first, last, out);
     });
-    test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t n) {
+    test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t n) {
       std::copy_backward(first, last, out + n);
     });
-    test_one<InIter, SentWrapper, OutIter>([](auto first, auto, auto out, size_t n) {
+    test_one<InIter, SentWrapper, OutIter>([](auto first, auto, auto out, std::size_t n) {
       std::copy_n(first, n, out);
     });
   }
 
   // Ranges.
-  test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t) {
+  test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t) {
     std::ranges::copy(first, last, out);
   });
-  test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t n) {
+  test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t n) {
     std::ranges::copy_backward(first, last, out + n);
   });
-  test_one<InIter, SentWrapper, OutIter>([](auto first, auto, auto out, size_t n) {
+  test_one<InIter, SentWrapper, OutIter>([](auto first, auto, auto out, std::size_t n) {
     std::ranges::copy_n(first, n, out);
   });
 }
@@ -237,19 +237,19 @@ constexpr void test_copy() {
 template <class InIter, template <class> class SentWrapper, class OutIter>
 constexpr void test_move() {
   if constexpr (std::same_as<InIter, SentWrapper<InIter>>) {
-    test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t) {
+    test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t) {
       std::move(first, last, out);
     });
-    test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t n) {
+    test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t n) {
       std::move_backward(first, last, out + n);
     });
   }
 
   // Ranges.
-  test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t) {
+  test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t) {
     std::ranges::move(first, last, out);
   });
-  test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t n) {
+  test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t n) {
     std::ranges::move_backward(first, last, out + n);
   });
 }

diff  --git a/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_trivial.pass.cpp b/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_trivial.pass.cpp
index 7505e5727cd76..7c2d388a69947 100644
--- a/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_trivial.pass.cpp
+++ b/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_trivial.pass.cpp
@@ -36,7 +36,7 @@ static bool memmove_called = false;
 // This template is a better match than the actual `builtin_memmove` (it can match the pointer type exactly, without an
 // implicit conversion to `void*`), so it should hijack the call inside `std::copy` and similar algorithms if it's made.
 template <class Dst, class Src>
-constexpr void* __builtin_memmove(Dst* dst, Src* src, size_t count) {
+constexpr void* __builtin_memmove(Dst* dst, Src* src, std::size_t count) {
   memmove_called = true;
   return __builtin_memmove(static_cast<void*>(dst), static_cast<const void*>(src), count);
 }
@@ -135,7 +135,7 @@ void test_one(Func func) {
 
   // Normal case.
   {
-    const size_t N = 4;
+    const std::size_t N = 4;
 
     From input[N] = {make<From>(1), make<From>(2), make<From>(3), make<From>(4)};
     To output[N];
@@ -162,7 +162,7 @@ void test_one(Func func) {
 
   // Empty input sequence.
   {
-    const size_t N = 0;
+    const std::size_t N = 0;
 
     From input[1]  = {make<From>(1)};
     To output[1] = {make<To>(2)};
@@ -185,37 +185,37 @@ template <class InIter, template <class> class SentWrapper, class OutIter>
 void test_copy_and_move() {
   // Classic.
   if constexpr (std::same_as<InIter, SentWrapper<InIter>>) {
-    test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t) {
+    test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t) {
       std::copy(first, last, out);
     });
-    test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t n) {
+    test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t n) {
       std::copy_backward(first, last, out + n);
     });
-    test_one<InIter, SentWrapper, OutIter>([](auto first, auto, auto out, size_t n) {
+    test_one<InIter, SentWrapper, OutIter>([](auto first, auto, auto out, std::size_t n) {
       std::copy_n(first, n, out);
     });
-    test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t) {
+    test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t) {
       std::move(first, last, out);
     });
-    test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t n) {
+    test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t n) {
       std::move_backward(first, last, out + n);
     });
   }
 
   // Ranges.
-  test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t) {
+  test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t) {
     std::ranges::copy(first, last, out);
   });
-  test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t n) {
+  test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t n) {
     std::ranges::copy_backward(first, last, out + n);
   });
-  test_one<InIter, SentWrapper, OutIter>([](auto first, auto, auto out, size_t n) {
+  test_one<InIter, SentWrapper, OutIter>([](auto first, auto, auto out, std::size_t n) {
     std::ranges::copy_n(first, n, out);
   });
-  test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t) {
+  test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t) {
     std::ranges::move(first, last, out);
   });
-  test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, size_t n) {
+  test_one<InIter, SentWrapper, OutIter>([](auto first, auto last, auto out, std::size_t n) {
     std::ranges::move_backward(first, last, out + n);
   });
 }
@@ -281,36 +281,36 @@ void test_
diff erent_signedness() {
     }
   };
 
-  check([](auto first, auto last, auto out, size_t) {
+  check([](auto first, auto last, auto out, std::size_t) {
     std::copy(first, last, out);
   });
-  check([](auto first, auto last, auto out, size_t n) {
+  check([](auto first, auto last, auto out, std::size_t n) {
     std::copy_backward(first, last, out + n);
   });
-  check([](auto first, auto, auto out, size_t n) {
+  check([](auto first, auto, auto out, std::size_t n) {
     std::copy_n(first, n, out);
   });
-  check([](auto first, auto last, auto out, size_t) {
+  check([](auto first, auto last, auto out, std::size_t) {
     std::move(first, last, out);
   });
-  check([](auto first, auto last, auto out, size_t n) {
+  check([](auto first, auto last, auto out, std::size_t n) {
     std::move_backward(first, last, out + n);
   });
 
   // Ranges.
-  check([](auto first, auto last, auto out, size_t) {
+  check([](auto first, auto last, auto out, std::size_t) {
     std::ranges::copy(first, last, out);
   });
-  check([](auto first, auto last, auto out, size_t n) {
+  check([](auto first, auto last, auto out, std::size_t n) {
     std::ranges::copy_backward(first, last, out + n);
   });
-  check([](auto first, auto, auto out, size_t n) {
+  check([](auto first, auto, auto out, std::size_t n) {
     std::ranges::copy_n(first, n, out);
   });
-  check([](auto first, auto last, auto out, size_t) {
+  check([](auto first, auto last, auto out, std::size_t) {
     std::ranges::move(first, last, out);
   });
-  check([](auto first, auto last, auto out, size_t n) {
+  check([](auto first, auto last, auto out, std::size_t n) {
     std::ranges::move_backward(first, last, out + n);
   });
 }

diff  --git a/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_unwrap_reverse.pass.cpp b/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_unwrap_reverse.pass.cpp
index bb01cc4e7322e..f295b807864ea 100644
--- a/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_unwrap_reverse.pass.cpp
+++ b/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_unwrap_reverse.pass.cpp
@@ -22,13 +22,13 @@
 
 #include "test_iterators.h"
 
-template <size_t N, class Iter>
+template <std::size_t N, class Iter>
 requires (N == 0)
 constexpr auto wrap_n_times(Iter i) {
   return i;
 }
 
-template <size_t N, class Iter>
+template <std::size_t N, class Iter>
 requires (N != 0)
 constexpr auto wrap_n_times(Iter i) {
   return std::make_reverse_iterator(wrap_n_times<N - 1>(i));
@@ -37,12 +37,12 @@ constexpr auto wrap_n_times(Iter i) {
 static_assert(std::is_same_v<decltype(wrap_n_times<2>(std::declval<int*>())),
                              std::reverse_iterator<std::reverse_iterator<int*>>>);
 
-template <class InIter, template <class> class SentWrapper, class OutIter, size_t W1, size_t W2, class Func>
+template <class InIter, template <class> class SentWrapper, class OutIter, std::size_t W1, size_t W2, class Func>
 constexpr void test_one(Func func) {
   using From = std::iter_value_t<InIter>;
   using To = std::iter_value_t<OutIter>;
 
-  const size_t N = 4;
+  const std::size_t N = 4;
 
   From input[N] = {{1}, {2}, {3}, {4}};
   To output[N];
@@ -60,46 +60,46 @@ constexpr void test_one(Func func) {
     }));
 }
 
-template <class InIter, template <class> class SentWrapper, class OutIter, size_t W1, size_t W2>
+template <class InIter, template <class> class SentWrapper, class OutIter, std::size_t W1, size_t W2>
 constexpr void test_copy_and_move() {
   // Classic.
   if constexpr (std::same_as<InIter, SentWrapper<InIter>>) {
-    test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, size_t) {
+    test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, std::size_t) {
       std::copy(first, last, out);
     });
-    test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, size_t n) {
+    test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, std::size_t n) {
       std::copy_backward(first, last, out + n);
     });
-    test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto, auto out, size_t n) {
+    test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto, auto out, std::size_t n) {
       std::copy_n(first, n, out);
     });
-    test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, size_t) {
+    test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, std::size_t) {
       std::move(first, last, out);
     });
-    test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, size_t n) {
+    test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, std::size_t n) {
       std::move_backward(first, last, out + n);
     });
   }
 
   // Ranges.
-  test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, size_t) {
+  test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, std::size_t) {
     std::ranges::copy(first, last, out);
   });
-  test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, size_t n) {
+  test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, std::size_t n) {
     std::ranges::copy_backward(first, last, out + n);
   });
-  test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto, auto out, size_t n) {
+  test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto, auto out, std::size_t n) {
     std::ranges::copy_n(first, n, out);
   });
-  test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, size_t) {
+  test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, std::size_t) {
     std::ranges::move(first, last, out);
   });
-  test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, size_t n) {
+  test_one<InIter, SentWrapper, OutIter, W1, W2>([](auto first, auto last, auto out, std::size_t n) {
     std::ranges::move_backward(first, last, out + n);
   });
 }
 
-template <size_t W1, size_t W2, class From, class To, template <class> class SentWrapper>
+template <std::size_t W1, size_t W2, class From, class To, template <class> class SentWrapper>
 constexpr void test_all_permutations_with_counts_from_to_sent() {
   test_copy_and_move<From*, SentWrapper, To*, W1, W2>();
   test_copy_and_move<contiguous_iterator<From*>, SentWrapper, To*, W1, W2>();
@@ -114,7 +114,7 @@ constexpr void test_all_permutations_with_counts_from_to_sent() {
   }
 }
 
-template <size_t W1, size_t W2>
+template <std::size_t W1, size_t W2>
 constexpr void test_all_permutations_with_counts() {
   test_all_permutations_with_counts_from_to_sent<W1, W2, int, int, std::type_identity_t>();
   test_all_permutations_with_counts_from_to_sent<W1, W2, int, int, sized_sentinel>();

diff  --git a/libcxx/test/libcxx/algorithms/debug_less.pass.cpp b/libcxx/test/libcxx/algorithms/debug_less.pass.cpp
index 89f12e5aa0cd3..4d6422a07a020 100644
--- a/libcxx/test/libcxx/algorithms/debug_less.pass.cpp
+++ b/libcxx/test/libcxx/algorithms/debug_less.pass.cpp
@@ -206,10 +206,10 @@ void test_non_const_arg_cmp() {
 
 struct ValueIterator {
     typedef std::input_iterator_tag iterator_category;
-    typedef size_t value_type;
+    typedef std::size_t value_type;
     typedef ptr
diff _t 
diff erence_type;
-    typedef size_t reference;
-    typedef size_t* pointer;
+    typedef std::size_t reference;
+    typedef std::size_t* pointer;
 
     ValueIterator() { }
 

diff  --git a/libcxx/test/libcxx/algorithms/half_positive.pass.cpp b/libcxx/test/libcxx/algorithms/half_positive.pass.cpp
index 997679629dac6..82d18cba37f34 100644
--- a/libcxx/test/libcxx/algorithms/half_positive.pass.cpp
+++ b/libcxx/test/libcxx/algorithms/half_positive.pass.cpp
@@ -35,7 +35,7 @@ int main(int, char**)
         assert(test<int>());
         assert(test<long>());
         assert((test<UserDefinedIntegral<int>, int>()));
-        assert(test<size_t>());
+        assert(test<std::size_t>());
 #if !defined(TEST_HAS_NO_INT128)
         assert(test<__int128_t>());
 #endif // !defined(TEST_HAS_NO_INT128)
@@ -46,7 +46,7 @@ int main(int, char**)
         static_assert(test<char>(), "");
         static_assert(test<int>(), "");
         static_assert(test<long>(), "");
-        static_assert(test<size_t>(), "");
+        static_assert(test<std::size_t>(), "");
 #if !defined(TEST_HAS_NO_INT128)
         static_assert(test<__int128_t>(), "");
 #endif // !defined(TEST_HAS_NO_INT128)

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/exception_safety_exceptions_disabled.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/exception_safety_exceptions_disabled.pass.cpp
index dc771116cfa6a..df562474c185a 100644
--- a/libcxx/test/libcxx/containers/sequences/vector/exception_safety_exceptions_disabled.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/exception_safety_exceptions_disabled.pass.cpp
@@ -41,8 +41,8 @@ int main(int, char**) {
   // Create a vector containing some number of elements that will
   // have to be moved when it is resized.
   v.reserve(10);
-  size_t old_cap = v.capacity();
-  for (size_t i = 0; i < v.capacity(); ++i) {
+  std::size_t old_cap = v.capacity();
+  for (std::size_t i = 0; i < v.capacity(); ++i) {
     v.emplace_back(42);
   }
   assert(v.capacity() == old_cap);

diff  --git a/libcxx/test/libcxx/containers/unord/next_pow2.pass.cpp b/libcxx/test/libcxx/containers/unord/next_pow2.pass.cpp
index 5146f41dbe49a..4aa87d30b3f0b 100644
--- a/libcxx/test/libcxx/containers/unord/next_pow2.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/next_pow2.pass.cpp
@@ -31,7 +31,7 @@ is_power_of_two(unsigned long n)
     return __builtin_popcount(n) == 1;
 }
 
-void test_next_pow2_val(size_t n)
+void test_next_pow2_val(std::size_t n)
 {
         std::size_t npow2 = std::__next_hash_pow2(n);
         assert(is_power_of_two(npow2) && npow2 > n);

diff  --git a/libcxx/test/libcxx/containers/unord/next_prime.pass.cpp b/libcxx/test/libcxx/containers/unord/next_prime.pass.cpp
index 642e5fa1d63f5..d19ab1ebb505a 100644
--- a/libcxx/test/libcxx/containers/unord/next_prime.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/next_prime.pass.cpp
@@ -22,7 +22,7 @@
 #include "test_macros.h"
 
 bool
-is_prime(size_t n)
+is_prime(std::size_t n)
 {
     switch (n)
     {
@@ -30,7 +30,7 @@ is_prime(size_t n)
     case 1:
         return false;
     }
-    for (size_t i = 2; i*i <= n; ++i)
+    for (std::size_t i = 2; i*i <= n; ++i)
     {
         if (n % i == 0)
             return false;

diff  --git a/libcxx/test/libcxx/containers/unord/non_const_comparator.verify.cpp b/libcxx/test/libcxx/containers/unord/non_const_comparator.verify.cpp
index 0452d080a7124..a5d529dacef4c 100644
--- a/libcxx/test/libcxx/containers/unord/non_const_comparator.verify.cpp
+++ b/libcxx/test/libcxx/containers/unord/non_const_comparator.verify.cpp
@@ -17,7 +17,7 @@
 
 struct BadHash {
   template <class T>
-  size_t operator()(T const& t) {
+  std::size_t operator()(T const& t) {
     return std::hash<T>{}(t);
   }
 };

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/missing_hash_specialization.fail.cpp b/libcxx/test/libcxx/containers/unord/unord.set/missing_hash_specialization.fail.cpp
index 45be37d1c86de..f492b760edf26 100644
--- a/libcxx/test/libcxx/containers/unord/unord.set/missing_hash_specialization.fail.cpp
+++ b/libcxx/test/libcxx/containers/unord/unord.set/missing_hash_specialization.fail.cpp
@@ -28,7 +28,7 @@ struct BadHashNoCopy {
   BadHashNoCopy(BadHashNoCopy const&) = delete;
 
   template <class T>
-  size_t operator()(T const&) const { return 0; }
+  std::size_t operator()(T const&) const { return 0; }
 };
 
 struct BadHashNoCall {
@@ -39,7 +39,7 @@ struct BadHashNoCall {
 struct GoodHashNoDefault {
   explicit GoodHashNoDefault(void*) {}
   template <class T>
-  size_t operator()(T const&) const { return 0; }
+  std::size_t operator()(T const&) const { return 0; }
 };
 
 int main(int, char**) {

diff  --git a/libcxx/test/libcxx/debug/containers.multithread.pass.cpp b/libcxx/test/libcxx/debug/containers.multithread.pass.cpp
index a389c31b2142e..eb2373eb412a5 100644
--- a/libcxx/test/libcxx/debug/containers.multithread.pass.cpp
+++ b/libcxx/test/libcxx/debug/containers.multithread.pass.cpp
@@ -32,14 +32,14 @@ Container makeContainer(int size) {
 
 template <typename Container>
 void ThreadUseIter() {
-  const size_t maxRounds = 7;
+  const std::size_t maxRounds = 7;
   struct TestRunner{
     void operator()() {
-      for (size_t count = 0; count < maxRounds; count++) {
-        const size_t containerCount = 11;
+      for (std::size_t count = 0; count < maxRounds; count++) {
+        const std::size_t containerCount = 11;
         std::vector<Container> containers;
         std::vector<typename Container::iterator> iterators;
-        for (size_t containerIndex = 0; containerIndex < containerCount; containerIndex++) {
+        for (std::size_t containerIndex = 0; containerIndex < containerCount; containerIndex++) {
           containers.push_back(makeContainer<Container>(3));
           Container& c = containers.back();
           iterators.push_back(c.begin());
@@ -50,12 +50,12 @@ void ThreadUseIter() {
   };
 
   TestRunner r;
-  const size_t threadCount = 4;
+  const std::size_t threadCount = 4;
   std::vector<std::thread> threads;
-  for (size_t count = 0; count < threadCount; count++)
+  for (std::size_t count = 0; count < threadCount; count++)
     threads.emplace_back(r);
   r();
-  for (size_t count = 0; count < threadCount; count++)
+  for (std::size_t count = 0; count < threadCount; count++)
     threads[count].join();
 }
 

diff  --git a/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.pass.cpp b/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.pass.cpp
index cca85103bcb12..da35465c5295b 100644
--- a/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.pass.cpp
+++ b/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.pass.cpp
@@ -29,15 +29,15 @@ static const bool UsingAlignedNew = true;
 #endif
 
 #ifdef __STDCPP_DEFAULT_NEW_ALIGNMENT__
-static const size_t MaxAligned = __STDCPP_DEFAULT_NEW_ALIGNMENT__;
+static const std::size_t MaxAligned = __STDCPP_DEFAULT_NEW_ALIGNMENT__;
 #else
-static const size_t MaxAligned = std::alignment_of<std::max_align_t>::value;
+static const std::size_t MaxAligned = std::alignment_of<std::max_align_t>::value;
 #endif
 
-static const size_t OverAligned = MaxAligned * 2;
+static const std::size_t OverAligned = MaxAligned * 2;
 
 
-template <size_t Align>
+template <std::size_t Align>
 struct TEST_ALIGNAS(Align) AlignedType {
   char data;
   static int constructed;
@@ -45,11 +45,11 @@ struct TEST_ALIGNAS(Align) AlignedType {
   AlignedType(AlignedType const&) { ++constructed; }
   ~AlignedType() { --constructed; }
 };
-template <size_t Align>
+template <std::size_t Align>
 int AlignedType<Align>::constructed = 0;
 
 
-template <size_t Align>
+template <std::size_t Align>
 void test_aligned() {
   typedef AlignedType<Align> T;
   T::constructed = 0;

diff  --git a/libcxx/test/libcxx/fuzzing/nth_element.pass.cpp b/libcxx/test/libcxx/fuzzing/nth_element.pass.cpp
index 5e491e76dfa22..45f4aed6fa412 100644
--- a/libcxx/test/libcxx/fuzzing/nth_element.pass.cpp
+++ b/libcxx/test/libcxx/fuzzing/nth_element.pass.cpp
@@ -18,7 +18,7 @@
 // Use the first element as a position into the data
 extern "C" int LLVMFuzzerTestOneInput(const std::uint8_t *data, std::size_t size) {
     if (size <= 1) return 0;
-    const size_t partition_point = data[0] % size;
+    const std::size_t partition_point = data[0] % size;
     std::vector<std::uint8_t> working(data + 1, data + size);
     const auto partition_iter = working.begin() + partition_point;
     std::nth_element(working.begin(), partition_iter, working.end());

diff  --git a/libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp b/libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp
index 28c964d4ccab9..7ef943fd30c1d 100644
--- a/libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp
+++ b/libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp
@@ -107,7 +107,7 @@ void operator delete(void* p)TEST_NOEXCEPT {
 }
 
 #ifndef NO_SIZE
-void operator delete(void* p, size_t n)TEST_NOEXCEPT {
+void operator delete(void* p, std::size_t n)TEST_NOEXCEPT {
   ::free(p);
   stats.sized_called++;
   stats.last_size = n;
@@ -123,7 +123,7 @@ void operator delete(void* p, std::align_val_t a)TEST_NOEXCEPT {
   stats.last_size = -1;
 }
 
-void operator delete(void* p, size_t n, std::align_val_t a)TEST_NOEXCEPT {
+void operator delete(void* p, std::size_t n, std::align_val_t a)TEST_NOEXCEPT {
   std::__libcpp_aligned_free(p);
   stats.aligned_sized_called++;
   stats.last_align = static_cast<int>(a);
@@ -134,12 +134,12 @@ void operator delete(void* p, size_t n, std::align_val_t a)TEST_NOEXCEPT {
 void test_libcpp_dealloc() {
   void* p = nullptr;
 #ifdef __STDCPP_DEFAULT_NEW_ALIGNMENT__
-  size_t over_align_val = __STDCPP_DEFAULT_NEW_ALIGNMENT__ * 2;
+  std::size_t over_align_val = __STDCPP_DEFAULT_NEW_ALIGNMENT__ * 2;
 #else
-  size_t over_align_val = TEST_ALIGNOF(std::max_align_t) * 2;
+  std::size_t over_align_val = TEST_ALIGNOF(std::max_align_t) * 2;
 #endif
-  size_t under_align_val = TEST_ALIGNOF(int);
-  size_t with_size_val = 2;
+  std::size_t under_align_val = TEST_ALIGNOF(int);
+  std::size_t with_size_val = 2;
 
   {
     std::__libcpp_deallocate_unsized(p, under_align_val);

diff  --git a/libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.pass.cpp b/libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.pass.cpp
index aecdcd6c787ae..32ef97e0241c8 100644
--- a/libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.pass.cpp
+++ b/libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.pass.cpp
@@ -29,7 +29,7 @@
 
 #include "test_macros.h"
 
-static void test_allocations(size_t size, size_t alignment) {
+static void test_allocations(std::size_t size, size_t alignment) {
   {
     void* ptr = ::operator new(size, std::align_val_t(alignment));
     assert(ptr);

diff  --git a/libcxx/test/libcxx/numerics/numeric.ops/midpoint.integer.pass.cpp b/libcxx/test/libcxx/numerics/numeric.ops/midpoint.integer.pass.cpp
index a89a3d69476cd..8df3f8ad8cade 100644
--- a/libcxx/test/libcxx/numerics/numeric.ops/midpoint.integer.pass.cpp
+++ b/libcxx/test/libcxx/numerics/numeric.ops/midpoint.integer.pass.cpp
@@ -63,7 +63,7 @@ int main(int, char**)
 
     test<char>();
     test<ptr
diff _t>();
-    test<size_t>();
+    test<std::size_t>();
 
     return 0;
 }

diff  --git a/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/no_unique_address.compile.pass.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/no_unique_address.compile.pass.cpp
index 37cd7151b3577..2918d4f86afb5 100644
--- a/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/no_unique_address.compile.pass.cpp
+++ b/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/no_unique_address.compile.pass.cpp
@@ -54,7 +54,7 @@ namespace test2 {
     int x;
     int* begin() const;
     int* end() const;
-    constexpr static size_t size() { return 1; }
+    constexpr static std::size_t size() { return 1; }
   };
   static_assert( std::ranges::forward_range<TinyView>);
   static_assert( std::ranges::__tiny_range<TinyView>);
@@ -107,7 +107,7 @@ namespace test4 {
   struct EmptyTinyView : std::ranges::view_base {
     int* begin() const;
     int* end() const;
-    constexpr static size_t size() { return 1; }
+    constexpr static std::size_t size() { return 1; }
   };
   static_assert( std::ranges::forward_range<EmptyTinyView>);
   static_assert( std::ranges::__tiny_range<EmptyTinyView>);

diff  --git a/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/types.h b/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/types.h
index a66b378451542..12b0de9aa6330 100644
--- a/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/types.h
+++ b/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/types.h
@@ -10,6 +10,7 @@
 #define TEST_LIBCXX_RANGES_RANGE_ADAPTORS_RANGE_LAZY_SPLIT_TYPES_H
 
 #include <concepts>
+#include <cstddef>
 #include <ranges>
 #include <string_view>
 #include "test_iterators.h"
@@ -53,7 +54,7 @@ struct ForwardTinyView : std::ranges::view_base {
   constexpr ForwardTinyView() = default;
   constexpr forward_iterator<const char*> begin() const { return forward_iterator<const char*>(nullptr); }
   constexpr forward_iterator<const char*> end() const { return forward_iterator<const char*>(nullptr); }
-  constexpr static size_t size() { return 1; }
+  constexpr static std::size_t size() { return 1; }
 };
 static_assert(std::ranges::forward_range<ForwardTinyView>);
 static_assert(std::ranges::view<ForwardTinyView>);

diff  --git a/libcxx/test/libcxx/strings/basic.string/alignof.compile.pass.cpp b/libcxx/test/libcxx/strings/basic.string/alignof.compile.pass.cpp
index 1613fd7b5fdaa..504b8c8a551da 100644
--- a/libcxx/test/libcxx/strings/basic.string/alignof.compile.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/alignof.compile.pass.cpp
@@ -132,5 +132,5 @@ static_assert(alignof(small_string<char32_t>) == 4, "");
 #  endif
 
 #else
-#  error "size_t has an unexpected size"
+#  error "std::size_t has an unexpected size"
 #endif

diff  --git a/libcxx/test/libcxx/strings/basic.string/sizeof.compile.pass.cpp b/libcxx/test/libcxx/strings/basic.string/sizeof.compile.pass.cpp
index 7a1835d0479f5..4d3eeb1bbce6e 100644
--- a/libcxx/test/libcxx/strings/basic.string/sizeof.compile.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/sizeof.compile.pass.cpp
@@ -131,5 +131,5 @@ static_assert(sizeof(small_string<char32_t>) == 12, "");
 #  endif
 
 #else
-#  error "size_t has an unexpected size"
+#  error "std::size_t has an unexpected size"
 #endif

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.capacity/max_size.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.capacity/max_size.pass.cpp
index 69b45f8a235b9..4bc622f843da6 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.capacity/max_size.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.capacity/max_size.pass.cpp
@@ -18,48 +18,48 @@
 #include "test_macros.h"
 
 // alignment of the string heap buffer is hardcoded to 16
-static const size_t alignment = 16;
+static const std::size_t alignment = 16;
 
 template <class = int>
 TEST_CONSTEXPR_CXX20 void full_size() {
   std::string str;
-  assert(str.max_size() == std::numeric_limits<size_t>::max() - alignment);
+  assert(str.max_size() == std::numeric_limits<std::size_t>::max() - alignment);
 
 #ifndef TEST_HAS_NO_CHAR8_T
   std::u8string u8str;
-  assert(u8str.max_size() == std::numeric_limits<size_t>::max() - alignment);
+  assert(u8str.max_size() == std::numeric_limits<std::size_t>::max() - alignment);
 #endif
 
 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
   std::wstring wstr;
-  assert(wstr.max_size() == std::numeric_limits<size_t>::max() / sizeof(wchar_t) - alignment);
+  assert(wstr.max_size() == std::numeric_limits<std::size_t>::max() / sizeof(wchar_t) - alignment);
 #endif
 
   std::u16string u16str;
   std::u32string u32str;
-  assert(u16str.max_size() == std::numeric_limits<size_t>::max() / 2 - alignment);
-  assert(u32str.max_size() == std::numeric_limits<size_t>::max() / 4 - alignment);
+  assert(u16str.max_size() == std::numeric_limits<std::size_t>::max() / 2 - alignment);
+  assert(u32str.max_size() == std::numeric_limits<std::size_t>::max() / 4 - alignment);
 }
 
 template <class = int>
 TEST_CONSTEXPR_CXX20 void half_size() {
   std::string str;
-  assert(str.max_size() == std::numeric_limits<size_t>::max() / 2 - alignment);
+  assert(str.max_size() == std::numeric_limits<std::size_t>::max() / 2 - alignment);
 
 #ifndef TEST_HAS_NO_CHAR8_T
   std::u8string u8str;
-  assert(u8str.max_size() == std::numeric_limits<size_t>::max() / 2 - alignment);
+  assert(u8str.max_size() == std::numeric_limits<std::size_t>::max() / 2 - alignment);
 #endif
 
 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
   std::wstring wstr;
-  assert(wstr.max_size() == std::numeric_limits<size_t>::max() / std::max<size_t>(2ul, sizeof(wchar_t)) - alignment);
+  assert(wstr.max_size() == std::numeric_limits<std::size_t>::max() / std::max<size_t>(2ul, sizeof(wchar_t)) - alignment);
 #endif
 
   std::u16string u16str;
   std::u32string u32str;
-  assert(u16str.max_size() == std::numeric_limits<size_t>::max() / 2 - alignment);
-  assert(u32str.max_size() == std::numeric_limits<size_t>::max() / 4 - alignment);
+  assert(u16str.max_size() == std::numeric_limits<std::size_t>::max() / 2 - alignment);
+  assert(u32str.max_size() == std::numeric_limits<std::size_t>::max() / 4 - alignment);
 }
 
 TEST_CONSTEXPR_CXX20 bool test() {

diff  --git a/libcxx/test/libcxx/type_traits/is_specialization.verify.cpp b/libcxx/test/libcxx/type_traits/is_specialization.verify.cpp
index 0dbdbf56f75c8..2fd1176417538 100644
--- a/libcxx/test/libcxx/type_traits/is_specialization.verify.cpp
+++ b/libcxx/test/libcxx/type_traits/is_specialization.verify.cpp
@@ -19,4 +19,4 @@
 #include <utility>
 
 // expected-error at +1 {{template template argument has 
diff erent template parameters than its corresponding template template parameter}}
-static_assert(!std::__is_specialization_v<std::pair<int, size_t>, std::array>);
+static_assert(!std::__is_specialization_v<std::pair<int, std::size_t>, std::array>);

diff  --git a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/extended_grapheme_cluster.h b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/extended_grapheme_cluster.h
index cfe7f4eb394a1..204dcacb1152c 100644
--- a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/extended_grapheme_cluster.h
+++ b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/extended_grapheme_cluster.h
@@ -78,7 +78,7 @@ struct data {
   /// The offset of the last code units of the extended grapheme clusters in the input.
   ///
   /// The vector has the same number of entries as \ref code_points.
-  std::vector<size_t> breaks;
+  std::vector<std::size_t> breaks;
 };
 
 /// The data for UTF-8.

diff  --git a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/extended_grapheme_cluster.pass.cpp b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/extended_grapheme_cluster.pass.cpp
index 9039ed051b612..512d27854e4a0 100644
--- a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/extended_grapheme_cluster.pass.cpp
+++ b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/extended_grapheme_cluster.pass.cpp
@@ -63,7 +63,7 @@ constexpr void test(const Data& data) {
     assert(d.code_points.size() == d.breaks.size());
 
     std::__unicode::__extended_grapheme_cluster_view view{d.input.begin(), d.input.end()};
-    for (size_t i = 0; i < d.breaks.size(); ++i) {
+    for (std::size_t i = 0; i < d.breaks.size(); ++i) {
       auto r = view.__consume();
       assert(r.__code_point_ == d.code_points[i]);
       assert(r.__last_ == d.input.begin() + d.breaks[i]);

diff  --git a/libcxx/test/libcxx/utilities/function.objects/unord.hash/murmur2_or_cityhash_ubsan_unsigned_overflow_ignored.pass.cpp b/libcxx/test/libcxx/utilities/function.objects/unord.hash/murmur2_or_cityhash_ubsan_unsigned_overflow_ignored.pass.cpp
index 73ad7aa5d03cb..11f0724f990c8 100644
--- a/libcxx/test/libcxx/utilities/function.objects/unord.hash/murmur2_or_cityhash_ubsan_unsigned_overflow_ignored.pass.cpp
+++ b/libcxx/test/libcxx/utilities/function.objects/unord.hash/murmur2_or_cityhash_ubsan_unsigned_overflow_ignored.pass.cpp
@@ -35,8 +35,8 @@ int main(int, char**) {
       "00000000000000000000000000000000000000000000000000000000000000000000000",
       "1237546895+54+4554985416849484213464984765465464654564565645645646546456546546"
   };
-  const size_t NumCases = sizeof(TestCases)/sizeof(TestCases[0]);
-  for (size_t i=0; i < NumCases; ++i)
+  const std::size_t NumCases = sizeof(TestCases)/sizeof(TestCases[0]);
+  for (std::size_t i=0; i < NumCases; ++i)
     test(TestCases[i].data(), TestCases[i].length());
 
   return 0;

diff  --git a/libcxx/test/libcxx/utilities/intseq/for_each_index_sequence.pass.cpp b/libcxx/test/libcxx/utilities/intseq/for_each_index_sequence.pass.cpp
index 77d7ddc3c38be..99345274da29e 100644
--- a/libcxx/test/libcxx/utilities/intseq/for_each_index_sequence.pass.cpp
+++ b/libcxx/test/libcxx/utilities/intseq/for_each_index_sequence.pass.cpp
@@ -19,7 +19,7 @@
 
 constexpr bool test() {
   int count = 0;
-  std::__for_each_index_sequence(std::make_index_sequence<8>(), [&]<size_t _Index> { count += _Index; });
+  std::__for_each_index_sequence(std::make_index_sequence<8>(), [&]<std::size_t _Index> { count += _Index; });
   assert(count == 28);
 
   return true;

diff  --git a/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_variant_overloads_impl.sh.cpp b/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_variant_overloads_impl.sh.cpp
index 6fdd02362386f..58b9db45d37a2 100644
--- a/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_variant_overloads_impl.sh.cpp
+++ b/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_variant_overloads_impl.sh.cpp
@@ -42,7 +42,7 @@
 #include "test_macros.h"
 #include "template_cost_testing.h"
 
-template <size_t Idx>
+template <std::size_t Idx>
 struct TestType {};
 
 template <class T>
@@ -54,7 +54,7 @@ namespace flat_impl {
 
 struct OverloadBase { void operator()() const; };
 
-template <class Tp, size_t Idx>
+template <class Tp, std::size_t Idx>
 struct Overload {
   auto operator()(Tp, Tp) const -> ID<Tp>;
 };
@@ -65,7 +65,7 @@ struct AllOverloads : OverloadBase, Bases... {};
 template <class IdxSeq>
 struct MakeOverloads;
 
-template <size_t ..._Idx>
+template <std::size_t ..._Idx>
 struct MakeOverloads<std::__tuple_indices<_Idx...> > {
   template <class ...Types>
   using Apply = AllOverloads<Overload<Types, _Idx>...>;

diff  --git a/libcxx/test/libcxx/utilities/variant/variant.variant/variant_size.pass.cpp b/libcxx/test/libcxx/utilities/variant/variant.variant/variant_size.pass.cpp
index 4e2d787117bc8..a2dc58bce1b64 100644
--- a/libcxx/test/libcxx/utilities/variant/variant.variant/variant_size.pass.cpp
+++ b/libcxx/test/libcxx/utilities/variant/variant.variant/variant_size.pass.cpp
@@ -22,13 +22,13 @@
 template <class Sequence>
 struct make_variant_imp;
 
-template <size_t ...Indices>
-struct make_variant_imp<std::integer_sequence<size_t, Indices...>> {
-  template <size_t> using AlwaysChar = char;
+template <std::size_t ...Indices>
+struct make_variant_imp<std::integer_sequence<std::size_t, Indices...>> {
+  template <std::size_t> using AlwaysChar = char;
   using type = std::variant<AlwaysChar<Indices>...>;
 };
 
-template <size_t N>
+template <std::size_t N>
 using make_variant_t = typename make_variant_imp<std::make_index_sequence<N>>::type;
 
 constexpr bool ExpectEqual =

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy_n.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy_n.pass.cpp
index 4a8963edae089..237d1ef115090 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy_n.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy_n.pass.cpp
@@ -23,7 +23,7 @@
 #include "almost_satisfies_types.h"
 #include "test_iterators.h"
 
-template <class In, class Out = In, class Count = size_t>
+template <class In, class Out = In, class Count = std::size_t>
 concept HasCopyNIt = requires(In in, Count count, Out out) { std::ranges::copy_n(in, count, out); };
 
 static_assert(HasCopyNIt<int*>);

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.fill/fill_n.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.fill/fill_n.pass.cpp
index 6bb784201b896..7d6770de702bf 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.fill/fill_n.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.fill/fill_n.pass.cpp
@@ -22,7 +22,7 @@
 
 #if TEST_STD_VER > 17
 TEST_CONSTEXPR bool test_constexpr() {
-    const size_t N = 5;
+    const std::size_t N = 5;
     int ib[] = {0, 0, 0, 0, 0, 0}; // one bigger than N
 
     auto it = std::fill_n(std::begin(ib), N, 5);

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp
index 3eb361a819d58..13fd1cbf1f33c 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp
@@ -31,7 +31,7 @@ struct gen_test
 
 #if TEST_STD_VER > 17
 TEST_CONSTEXPR bool test_constexpr() {
-    const size_t N = 5;
+    const std::size_t N = 5;
     int ib[] = {0, 0, 0, 0, 0, 0}; // one bigger than N
 
     auto it = std::generate_n(std::begin(ib), N, gen_test());

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate.pass.cpp
index 7cd53dc751139..56fbe58e2dfd0 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate.pass.cpp
@@ -99,7 +99,7 @@ static_assert(!HasGenerateRange<R<int*>, UninvocableGen>);
 static_assert(!HasGenerateRange<InputRangeNotInputOrOutputIterator>);
 static_assert(!HasGenerateRange<R<int*>, IntPtrGen>);
 
-template <class Iter, class Sent, size_t N, class Gen>
+template <class Iter, class Sent, std::size_t N, class Gen>
 constexpr void test_one(const std::array<int, N> input, Gen gen, std::array<int, N> expected) {
   { // (iterator, sentinel) overload.
     auto in = input;
@@ -174,7 +174,7 @@ constexpr bool test() {
     { // (iterator, sentinel) overload.
       int gen_invocations = 0;
       auto gen = [&gen_invocations] { ++gen_invocations; return AssignedOnce(); };
-      constexpr size_t N = 10;
+      constexpr std::size_t N = 10;
       std::array<AssignedOnce, N> in;
 
       std::ranges::generate(in.begin(), in.end(), gen);
@@ -185,7 +185,7 @@ constexpr bool test() {
     { // (range) overload.
       int gen_invocations = 0;
       auto gen = [&gen_invocations] { ++gen_invocations; return AssignedOnce(); };
-      constexpr size_t N = 10;
+      constexpr std::size_t N = 10;
       std::array<AssignedOnce, N> in;
 
       std::ranges::generate(in, gen);

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate_n.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate_n.pass.cpp
index 6a678322cb156..e6af0116ea0d2 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate_n.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate_n.pass.cpp
@@ -66,8 +66,8 @@ static_assert(!HasGenerateNIter<int*, UninvocableGen>);
 // !indirectly_writable<O, invoke_result_t<F&>>
 static_assert(!HasGenerateNIter<int*, IntPtrGen>);
 
-template <class Iter, size_t N, class Gen>
-constexpr void test_one(std::array<int, N> in, size_t n, Gen gen, std::array<int, N> expected) {
+template <class Iter, std::size_t N, class Gen>
+constexpr void test_one(std::array<int, N> in, std::size_t n, Gen gen, std::array<int, N> expected) {
   assert(n <= N);
 
   auto begin = Iter(in.data());
@@ -120,8 +120,8 @@ constexpr bool test() {
 
     int gen_invocations = 0;
     auto gen = [&gen_invocations] { ++gen_invocations; return AssignedOnce(); };
-    constexpr size_t N1 = 10;
-    constexpr size_t N2 = N1 / 2;
+    constexpr std::size_t N1 = 10;
+    constexpr std::size_t N2 = N1 / 2;
     std::array<AssignedOnce, N1> in;
 
     auto result = std::ranges::generate_n(in.begin(), N2, gen);

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition.pass.cpp
index 6779f78309edb..6d9be0441bfef 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition.pass.cpp
@@ -82,8 +82,8 @@ static_assert(!HasPartitionRange<R<PermutableNotForwardIterator>, UnaryPred>);
 static_assert(!HasPartitionRange<R<PermutableNotSwappable>, UnaryPred>);
 
 // `partition` isn't a stable algorithm so this function cannot test the exact output.
-template <class Iter, class Sent, size_t N, class Pred>
-constexpr void test_one(std::array<int, N> input, Pred pred, size_t partition_point) {
+template <class Iter, class Sent, std::size_t N, class Pred>
+constexpr void test_one(std::array<int, N> input, Pred pred, std::size_t partition_point) {
   auto neg_pred = [&](int x) { return !pred(x); };
 
   { // (iterator, sentinel) overload.

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_copy.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_copy.pass.cpp
index ba8a3479d707f..7b5b80dd8aaf8 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_copy.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_copy.pass.cpp
@@ -118,7 +118,7 @@ static_assert(!HasPartitionCopyRange<R<int*>, int*, Uncopyable*>);
 static_assert(std::is_same_v<std::ranges::partition_copy_result<int, int, int>,
     std::ranges::in_out_out_result<int, int, int>>);
 
-template <class Iter, class Sent, class OutIter1, class OutIter2, size_t N1, size_t N2, size_t N3, class Pred>
+template <class Iter, class Sent, class OutIter1, class OutIter2, std::size_t N1, size_t N2, size_t N3, class Pred>
 constexpr void test_one(std::array<int, N1> input, Pred pred, std::array<int, N2> expected_true,
     std::array<int, N3> expected_false) {
   static_assert(N2 + N3 == N1);

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_point.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_point.pass.cpp
index f9dadc28493b4..932e833aa499d 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_point.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_point.pass.cpp
@@ -76,8 +76,8 @@ static_assert(!HasPartitionPointRange<ForwardRangeNotIncrementable, UnaryPred>);
 static_assert(!HasPartitionPointRange<R<int*>, IndirectUnaryPredicateNotPredicate>);
 static_assert(!HasPartitionPointRange<R<int*>, IndirectUnaryPredicateNotCopyConstructible>);
 
-template <class Iter, class Sent, size_t N, class Pred>
-constexpr void test_one(std::array<int, N> input, Pred pred, size_t partition_point) {
+template <class Iter, class Sent, std::size_t N, class Pred>
+constexpr void test_one(std::array<int, N> input, Pred pred, std::size_t partition_point) {
   assert(std::ranges::is_partitioned(input, pred));
 
   auto begin = Iter(input.data());

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_stable_partition.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_stable_partition.pass.cpp
index b624abc6d5315..5c721059424da 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_stable_partition.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_stable_partition.pass.cpp
@@ -84,8 +84,8 @@ static_assert(!HasStablePartitionRange<R<int*>, IndirectUnaryPredicateNotCopyCon
 static_assert(!HasStablePartitionRange<R<PermutableNotForwardIterator>, UnaryPred>);
 static_assert(!HasStablePartitionRange<R<PermutableNotSwappable>, UnaryPred>);
 
-template <class Iter, class Sent, size_t N, class Pred>
-void test_one(std::array<int, N> input, Pred pred, size_t partition_point, std::array<int, N> expected) {
+template <class Iter, class Sent, std::size_t N, class Pred>
+void test_one(std::array<int, N> input, Pred pred, std::size_t partition_point, std::array<int, N> expected) {
   auto neg_pred = [&](int x) { return !pred(x); };
 
   { // (iterator, sentinel) overload.

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.sample/ranges_sample.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.sample/ranges_sample.pass.cpp
index 0a5d83e85b4a4..69db960ff362f 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.sample/ranges_sample.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.sample/ranges_sample.pass.cpp
@@ -36,10 +36,10 @@
 
 class RandGen {
 public:
-  constexpr static size_t min() { return 0; }
-  constexpr static size_t max() { return 255; }
+  constexpr static std::size_t min() { return 0; }
+  constexpr static std::size_t max() { return 255; }
 
-  constexpr size_t operator()() {
+  constexpr std::size_t operator()() {
     flip = !flip;
     return flip;
   }
@@ -54,9 +54,9 @@ static_assert(std::uniform_random_bit_generator<RandGen>);
 LIBCPP_STATIC_ASSERT(!std::__libcpp_random_is_valid_urng<RandGen>::value);
 
 struct BadGen {
-  constexpr static size_t min() { return 255; }
-  constexpr static size_t max() { return 0; }
-  constexpr size_t operator()() const;
+  constexpr static std::size_t min() { return 255; }
+  constexpr static std::size_t max() { return 0; }
+  constexpr std::size_t operator()() const;
 };
 static_assert(!std::uniform_random_bit_generator<BadGen>);
 
@@ -148,9 +148,9 @@ static_assert(!HasSampleRange<R<int*>, int**>);
 // !uniform_random_bit_generator<remove_reference_t<Gen>>
 static_assert(!HasSampleRange<R<int*>, int*, BadGen>);
 
-template <class Iter, class Sent, class Out, size_t N, class Gen>
-void test_one(std::array<int, N> in, size_t n, Gen gen) {
-  assert(n <= static_cast<size_t>(N));
+template <class Iter, class Sent, class Out, std::size_t N, class Gen>
+void test_one(std::array<int, N> in, std::size_t n, Gen gen) {
+  assert(n <= static_cast<std::size_t>(N));
 
   auto verify_is_subsequence = [&] (auto output) {
     auto sorted_input = in;
@@ -276,18 +276,18 @@ void test_generator() {
 // generator class has a const or non-const invocation operator (or both).
 void test_generators() {
   struct GenBase {
-    constexpr static size_t min() { return 0; }
-    constexpr static size_t max() { return 255; }
+    constexpr static std::size_t min() { return 0; }
+    constexpr static std::size_t max() { return 255; }
   };
   struct NonconstGen : GenBase {
-    size_t operator()() { return 1; }
+    std::size_t operator()() { return 1; }
   };
   struct ConstGen : GenBase {
-    size_t operator()() const { return 1; }
+    std::size_t operator()() const { return 1; }
   };
   struct ConstAndNonconstGen : GenBase {
-    size_t operator()() { return 1; }
-    size_t operator()() const { return 1; }
+    std::size_t operator()() { return 1; }
+    std::size_t operator()() const { return 1; }
   };
 
   test_generator<ConstGen>();

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/ranges_shuffle.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/ranges_shuffle.pass.cpp
index 6f6be6d0cb934..24237b94502f9 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/ranges_shuffle.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/ranges_shuffle.pass.cpp
@@ -34,10 +34,10 @@
 
 class RandGen {
 public:
-  constexpr static size_t min() { return 0; }
-  constexpr static size_t max() { return 255; }
+  constexpr static std::size_t min() { return 0; }
+  constexpr static std::size_t max() { return 255; }
 
-  constexpr size_t operator()() {
+  constexpr std::size_t operator()() {
     flip = !flip;
     return flip;
   }
@@ -52,9 +52,9 @@ static_assert(std::uniform_random_bit_generator<RandGen>);
 LIBCPP_STATIC_ASSERT(!std::__libcpp_random_is_valid_urng<RandGen>::value);
 
 struct BadGen {
-  constexpr static size_t min() { return 255; }
-  constexpr static size_t max() { return 0; }
-  constexpr size_t operator()() const;
+  constexpr static std::size_t min() { return 255; }
+  constexpr static std::size_t max() { return 0; }
+  constexpr std::size_t operator()() const;
 };
 static_assert(!std::uniform_random_bit_generator<BadGen>);
 
@@ -109,7 +109,7 @@ static_assert(!HasShuffleRange<PermutableNotSwappable>);
 // !uniform_random_bit_generator<remove_reference_t<Gen>>
 static_assert(!HasShuffleRange<R<int*>, BadGen>);
 
-template <class Iter, class Sent, size_t N, class Gen>
+template <class Iter, class Sent, std::size_t N, class Gen>
 void test_one(const std::array<int, N> input, Gen gen) {
   { // (iterator, sentinel) overload.
     auto shuffled = input;
@@ -219,18 +219,18 @@ void test_generator() {
 // generator class has a const or non-const invocation operator (or both).
 void test_generators() {
   struct GenBase {
-    constexpr static size_t min() { return 0; }
-    constexpr static size_t max() { return 255; }
+    constexpr static std::size_t min() { return 0; }
+    constexpr static std::size_t max() { return 255; }
   };
   struct NonconstGen : GenBase {
-    size_t operator()() { return 1; }
+    std::size_t operator()() { return 1; }
   };
   struct ConstGen : GenBase {
-    size_t operator()() const { return 1; }
+    std::size_t operator()() const { return 1; }
   };
   struct ConstAndNonconstGen : GenBase {
-    size_t operator()() { return 1; }
-    size_t operator()() const { return 1; }
+    std::size_t operator()() { return 1; }
+    std::size_t operator()() const { return 1; }
   };
 
   test_generator<ConstGen>();

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.reverse/ranges.reverse.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.reverse/ranges.reverse.pass.cpp
index fbeb8a433354f..c1011f3ada649 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.reverse/ranges.reverse.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.reverse/ranges.reverse.pass.cpp
@@ -45,7 +45,7 @@ static_assert(!HasReverseR<BidirectionalRangeNotDecrementable>);
 static_assert(!HasReverseR<PermutableRangeNotForwardIterator>);
 static_assert(!HasReverseR<PermutableRangeNotSwappable>);
 
-template <class Iter, class Sent, size_t N>
+template <class Iter, class Sent, std::size_t N>
 constexpr void test(std::array<int, N> value, std::array<int, N> expected) {
   {
     auto val = value;

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/ranges.rotate_copy.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/ranges.rotate_copy.pass.cpp
index b41ff4ed7f217..1f18d787c2f4c 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/ranges.rotate_copy.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/ranges.rotate_copy.pass.cpp
@@ -51,7 +51,7 @@ static_assert(!HasRotateCopyR<UncheckedRange<int*>, OutputIteratorNotInputOrOutp
 static_assert(std::is_same_v<std::ranges::rotate_copy_result<int, int>, std::ranges::in_out_result<int, int>>);
 
 template <class Iter, class OutIter, class Sent, int N>
-constexpr void test(std::array<int, N> value, size_t middle, std::array<int, N> expected) {
+constexpr void test(std::array<int, N> value, std::size_t middle, std::array<int, N> expected) {
   {
     std::array<int, N> out;
     std::same_as<std::ranges::in_out_result<Iter, OutIter>> decltype(auto) ret =

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/ranges_rotate.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/ranges_rotate.pass.cpp
index c34dac1c4798a..1506ce79b5dbd 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/ranges_rotate.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/ranges_rotate.pass.cpp
@@ -68,8 +68,8 @@ static_assert(!HasRotateRange<ForwardRangeNotSentinelEqualityComparableWith>);
 static_assert(!HasRotateRange<PermutableRangeNotForwardIterator>);
 static_assert(!HasRotateRange<PermutableRangeNotSwappable>);
 
-template <class Iter, class Sent, size_t N>
-constexpr void test_one(const std::array<int, N> input, size_t mid_index, std::array<int, N> expected) {
+template <class Iter, class Sent, std::size_t N>
+constexpr void test_one(const std::array<int, N> input, std::size_t mid_index, std::array<int, N> expected) {
   assert(mid_index <= N);
 
   { // (iterator, sentinel) overload.
@@ -159,7 +159,7 @@ constexpr bool test() {
       auto begin = adl::Iterator::TrackSwaps(in.data(), swaps);
       auto end = adl::Iterator::TrackSwaps(in.data() + in.size(), swaps);
 
-      for (size_t mid = 0; mid != input.size(); ++mid) {
+      for (std::size_t mid = 0; mid != input.size(); ++mid) {
         std::ranges::rotate(begin, begin + mid, end);
         assert(swaps <= expected);
       }
@@ -172,7 +172,7 @@ constexpr bool test() {
       auto end = adl::Iterator::TrackSwaps(in.data() + in.size(), swaps);
       auto range = std::ranges::subrange(begin, end);
 
-      for (size_t mid = 0; mid != input.size(); ++mid) {
+      for (std::size_t mid = 0; mid != input.size(); ++mid) {
         std::ranges::rotate(range, begin + mid);
         assert(swaps <= expected);
       }

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate_copy.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate_copy.pass.cpp
index cba0d3b1b7a95..c19f44a6d7eeb 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate_copy.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate_copy.pass.cpp
@@ -115,7 +115,7 @@ TEST_CONSTEXPR_CXX20 void test() {
     int const n_ints = sizeof(ints)/sizeof(int);
     int zeros[n_ints] = {0};
 
-    const size_t N = 2;
+    const std::size_t N = 2;
     const auto middle = std::begin(ints) + N;
     auto it = std::rotate_copy(std::begin(ints), middle, std::end(ints), std::begin(zeros));
     assert(std::distance(std::begin(zeros), it) == n_ints);

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp
index 7046d6a2bd408..b145d567f47bf 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp
@@ -25,7 +25,7 @@
 TEST_CONSTEXPR bool test_constexpr() {
           int ia[]       = {0, 1, 1, 3, 4};
     const int expected[] = {0, 1, 3, 4};
-    const size_t N = 4;
+    const std::size_t N = 4;
 
     auto it = std::unique(std::begin(ia), std::end(ia));
     return it == (std::begin(ia) + N)

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp
index 9f0c695e212dc..91535f081ca8b 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp
@@ -25,7 +25,7 @@
 TEST_CONSTEXPR bool test_constexpr() {
           int ia[]       = {0, 1, 1, 3, 4};
     const int expected[] = {0, 1, 3, 4};
-    const size_t N = 4;
+    const std::size_t N = 4;
 
     auto it = std::unique(std::begin(ia), std::end(ia), [](int a, int b) {return a == b; });
     return it == (std::begin(ia) + N)

diff  --git a/libcxx/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/ranges.adjacent_find.pass.cpp b/libcxx/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/ranges.adjacent_find.pass.cpp
index c040e27cc9b0f..d2e0bb5d182d6 100644
--- a/libcxx/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/ranges.adjacent_find.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/ranges.adjacent_find.pass.cpp
@@ -51,13 +51,13 @@ static_assert(!HasAdjacentFindR<ForwardRangeNotSentinelSemiregular>);
 static_assert(!HasAdjacentFindR<ForwardRangeNotSentinelEqualityComparableWith>);
 static_assert(!HasAdjacentFindR<UncheckedRange<NotComparable>>);
 
-template <size_t N>
+template <std::size_t N>
 struct Data {
   std::array<int, N> input;
   int expected;
 };
 
-template <class Iter, class Sent, size_t N>
+template <class Iter, class Sent, std::size_t N>
 constexpr void test(Data<N> d) {
   {
     std::same_as<Iter> decltype(auto) ret =

diff  --git a/libcxx/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp b/libcxx/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp
index 6eb5c247a211e..371f6c92f1ed1 100644
--- a/libcxx/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp
@@ -25,7 +25,7 @@
 TEST_CONSTEXPR bool test_constexpr() {
     int ia[] = {1, 3, 6, 7};
     int expected[] = {3, 5, 8, 9};
-    const size_t N = 4;
+    const std::size_t N = 4;
 
     auto it = std::for_each_n(std::begin(ia), N, [](int &a) { a += 2; });
     return it == (std::begin(ia) + N)

diff  --git a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap.pass.cpp
index f294d9de25033..fc207c9fc7529 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap.pass.cpp
@@ -72,7 +72,7 @@ static_assert(!HasIsHeapRange<RandomAccessRangeBadIndex>);
 // !indirect_strict_weak_order<Comp, projected<iterator_t<R>, Proj>>
 static_assert(!HasIsHeapRange<R<NoComparator*>>);
 
-template <class Iter, class Sent, size_t N>
+template <class Iter, class Sent, std::size_t N>
 constexpr void test_one(std::array<int, N> input, bool expected) {
   auto begin = Iter(input.data());
   auto end = Sent(Iter(input.data() + input.size()));

diff  --git a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap_until.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap_until.pass.cpp
index e6a74fe0f8d35..f1dc6adbeaae1 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap_until.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap_until.pass.cpp
@@ -72,8 +72,8 @@ static_assert(!HasIsHeapUntilRange<RandomAccessRangeBadIndex>);
 // !indirect_strict_weak_order<Comp, projected<iterator_t<R>, Proj>>
 static_assert(!HasIsHeapUntilRange<R<NoComparator*>>);
 
-template <class Iter, class Sent, size_t N>
-constexpr void test_one(std::array<int, N> input, size_t until_index) {
+template <class Iter, class Sent, std::size_t N>
+constexpr void test_one(std::array<int, N> input, std::size_t until_index) {
   auto begin = Iter(input.data());
   auto end = Sent(Iter(input.data() + input.size()));
 

diff  --git a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/ranges_make_heap.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/ranges_make_heap.pass.cpp
index 59b8283c16c23..5d8086df450ab 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/ranges_make_heap.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/ranges_make_heap.pass.cpp
@@ -58,14 +58,14 @@ static_assert(!HasMakeHeapR<UncheckedRange<int*, SentinelForNotWeaklyEqualityCom
 static_assert(!HasMakeHeapR<UncheckedRange<int*>, BadComparator>);
 static_assert(!HasMakeHeapR<UncheckedRange<const int*>>); // Doesn't satisfy `sortable`.
 
-template <size_t N, class T, class Iter>
+template <std::size_t N, class T, class Iter>
 constexpr void verify_heap(const std::array<T, N>& heapified, Iter last, std::array<T, N> expected) {
   assert(heapified == expected);
   assert(base(last) == heapified.data() + heapified.size());
   assert(std::is_heap(heapified.begin(), heapified.end()));
 }
 
-template <class Iter, class Sent, size_t N>
+template <class Iter, class Sent, std::size_t N>
 constexpr void test_one(const std::array<int, N> input, std::array<int, N> expected) {
   { // (iterator, sentinel) overload.
     auto heapified = input;

diff  --git a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/ranges_pop_heap.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/ranges_pop_heap.pass.cpp
index 6ce05db648f1f..e190586fef813 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/ranges_pop_heap.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/ranges_pop_heap.pass.cpp
@@ -58,7 +58,7 @@ static_assert(!HasPopHeapR<UncheckedRange<int*, SentinelForNotWeaklyEqualityComp
 static_assert(!HasPopHeapR<UncheckedRange<int*>, BadComparator>);
 static_assert(!HasPopHeapR<UncheckedRange<const int*>>); // Doesn't satisfy `sortable`.
 
-template <size_t N, class T, class Iter>
+template <std::size_t N, class T, class Iter>
 constexpr void verify_heap(const std::array<T, N>& heapified, Iter last, std::array<T, N> expected) {
   assert(heapified == expected);
   assert(base(last) == heapified.data() + heapified.size());
@@ -66,7 +66,7 @@ constexpr void verify_heap(const std::array<T, N>& heapified, Iter last, std::ar
   assert(*std::max_element(heapified.begin(), heapified.end()) == heapified.back());
 }
 
-template <class Iter, class Sent, size_t N>
+template <class Iter, class Sent, std::size_t N>
 constexpr void test_one(const std::array<int, N> input, std::array<int, N> expected) {
   assert(!input.empty());
   assert(std::is_heap(input.begin(), input.end()));

diff  --git a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/ranges_push_heap.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/ranges_push_heap.pass.cpp
index e2dc0accea457..331f07755fae4 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/ranges_push_heap.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/ranges_push_heap.pass.cpp
@@ -58,14 +58,14 @@ static_assert(!HasPushHeapR<UncheckedRange<int*, SentinelForNotWeaklyEqualityCom
 static_assert(!HasPushHeapR<UncheckedRange<int*>, BadComparator>);
 static_assert(!HasPushHeapR<UncheckedRange<const int*>>); // Doesn't satisfy `sortable`.
 
-template <size_t N, class T, class Iter>
+template <std::size_t N, class T, class Iter>
 constexpr void verify_heap(const std::array<T, N>& heapified, Iter last, std::array<T, N> expected) {
   assert(heapified == expected);
   assert(base(last) == heapified.data() + heapified.size());
   assert(std::is_heap(heapified.begin(), heapified.end()));
 }
 
-template <class Iter, class Sent, size_t N>
+template <class Iter, class Sent, std::size_t N>
 constexpr void test_one(const std::array<int, N> input, std::array<int, N> expected) {
   if (!input.empty()) {
     assert(std::is_heap(input.begin(), input.end() - 1));

diff  --git a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/ranges_sort_heap.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/ranges_sort_heap.pass.cpp
index abf317a753406..128ff80aadbef 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/ranges_sort_heap.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/ranges_sort_heap.pass.cpp
@@ -59,14 +59,14 @@ static_assert(!HasSortHeapR<UncheckedRange<int*, SentinelForNotWeaklyEqualityCom
 static_assert(!HasSortHeapR<UncheckedRange<int*>, BadComparator>);
 static_assert(!HasSortHeapR<UncheckedRange<const int*>>); // Doesn't satisfy `sortable`.
 
-template <size_t N, class T, class Iter>
+template <std::size_t N, class T, class Iter>
 constexpr void verify_sorted(const std::array<T, N>& sorted, Iter last, std::array<T, N> expected) {
   assert(sorted == expected);
   assert(base(last) == sorted.data() + sorted.size());
   assert(std::is_sorted(sorted.begin(), sorted.end()));
 }
 
-template <class Iter, class Sent, size_t N>
+template <class Iter, class Sent, std::size_t N>
 constexpr void test_one(const std::array<int, N> input, std::array<int, N> expected) {
   assert(std::is_heap(input.begin(), input.end()));
 

diff  --git a/libcxx/test/std/algorithms/alg.sorting/alg.nth.element/ranges_nth_element.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.nth.element/ranges_nth_element.pass.cpp
index a648e7df10a10..ad3c8ab699ab4 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.nth.element/ranges_nth_element.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.nth.element/ranges_nth_element.pass.cpp
@@ -64,8 +64,8 @@ static_assert(!HasNthElementR<UncheckedRange<int*, SentinelForNotWeaklyEqualityC
 static_assert(!HasNthElementR<UncheckedRange<int*>, BadComparator>);
 static_assert(!HasNthElementR<UncheckedRange<const int*>>); // Doesn't satisfy `sortable`.
 
-template <size_t N, class T, class Iter>
-constexpr void verify_nth(const std::array<T, N>& partially_sorted, size_t nth_index, Iter last, T expected_nth) {
+template <std::size_t N, class T, class Iter>
+constexpr void verify_nth(const std::array<T, N>& partially_sorted, std::size_t nth_index, Iter last, T expected_nth) {
   // Note that the exact output of `nth_element` is unspecified and may vary between implementations.
 
   assert(base(last) == partially_sorted.end());
@@ -92,8 +92,8 @@ constexpr void verify_nth(const std::array<T, N>& partially_sorted, size_t nth_i
   }
 }
 
-template <class Iter, class Sent, size_t N>
-constexpr void test_one(std::array<int, N> input, size_t nth_index, std::optional<int> expected_nth = {}) {
+template <class Iter, class Sent, std::size_t N>
+constexpr void test_one(std::array<int, N> input, std::size_t nth_index, std::optional<int> expected_nth = {}) {
   assert(expected_nth || nth_index == N);
 
   { // (iterator, sentinel) overload.
@@ -126,7 +126,7 @@ constexpr void test_one(std::array<int, N> input, size_t nth_index, std::optiona
   }
 }
 
-template <class Iter, class Sent, size_t N>
+template <class Iter, class Sent, std::size_t N>
 constexpr void test_all_cases(std::array<int, N> input) {
   auto sorted = input;
   std::sort(sorted.begin(), sorted.end());
@@ -162,7 +162,7 @@ constexpr void test_iterators() {
 
     { // nth element is in the right place.
       std::array input = {6, 5, 3, 1, 4, 2};
-      constexpr size_t N = input.size();
+      constexpr std::size_t N = input.size();
       test_one<Iter, Sent, N>(input, 2, /*expected_nth=*/3);
     }
 

diff  --git a/libcxx/test/std/algorithms/alg.sorting/alg.permutation.generators/ranges.next_permutation.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.permutation.generators/ranges.next_permutation.pass.cpp
index 5e7b8392909a4..77a7799ff11ad 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.permutation.generators/ranges.next_permutation.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.permutation.generators/ranges.next_permutation.pass.cpp
@@ -50,7 +50,7 @@ static_assert(!HasNextPermutationR<BidirectionalRangeNotSentinelSemiregular>);
 static_assert(!HasNextPermutationR<BidirectionalRangeNotSentinelWeaklyEqualityComparableWith>);
 static_assert(!HasNextPermutationR<UncheckedRange<const int*>>); // not sortable
 
-constexpr size_t factorial(size_t i) {
+constexpr std::size_t factorial(size_t i) {
   std::array memoized = {1, 1, 2, 6, 24, 120, 720, 5040, 40320};
   return memoized[i];
 }
@@ -87,8 +87,8 @@ constexpr void test_next_permutations(Func call_next_permutation) {
   // lexicographically greater than the previous. If these two conditions hold (the number of permutations is `N!`, and
   // each permutation is lexicographically greater than the previous one), it follows that the
   // `ranges::next_permutation` algorithm works correctly.
-  for (size_t i = 0; i <= current_permutation.size(); ++i) {
-    size_t count = 0;
+  for (std::size_t i = 0; i <= current_permutation.size(); ++i) {
+    std::size_t count = 0;
     bool next_found = true;
 
     while (next_found) {

diff  --git a/libcxx/test/std/algorithms/alg.sorting/alg.permutation.generators/ranges.prev_permutation.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.permutation.generators/ranges.prev_permutation.pass.cpp
index 3ec1af18e8466..a62138ed4f3b4 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.permutation.generators/ranges.prev_permutation.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.permutation.generators/ranges.prev_permutation.pass.cpp
@@ -50,7 +50,7 @@ static_assert(!HasPrevPermutationR<BidirectionalRangeNotSentinelSemiregular>);
 static_assert(!HasPrevPermutationR<BidirectionalRangeNotSentinelWeaklyEqualityComparableWith>);
 static_assert(!HasPrevPermutationR<UncheckedRange<const int*>>); // not sortable
 
-constexpr size_t factorial(size_t i) {
+constexpr std::size_t factorial(size_t i) {
   std::array memoized = {1, 1, 2, 6, 24, 120, 720, 5040, 40320};
   return memoized[i];
 }
@@ -87,8 +87,8 @@ constexpr void test_prev_permutations(Func call_prev_permutation) {
   // lexicographically less than the previous. If these two conditions hold (the number of permutations is `N!`, and
   // each permutation is lexicographically less than the previous one), it follows that the `ranges::prev_permutation`
   // algorithm works correctly.
-  for (size_t i = 0; i <= current_permutation.size(); ++i) {
-    size_t count = 0;
+  for (std::size_t i = 0; i <= current_permutation.size(); ++i) {
+    std::size_t count = 0;
     bool next_found = true;
 
     while (next_found) {

diff  --git a/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/ranges_partial_sort_copy.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/ranges_partial_sort_copy.pass.cpp
index 7a4ebd9c3ca03..532ee9b03efc0 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/ranges_partial_sort_copy.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/ranges_partial_sort_copy.pass.cpp
@@ -119,17 +119,17 @@ static_assert(!HasPartialSortCopyRange<R<NoComparator*>, R<NoComparator*>>);
 
 static_assert(std::is_same_v<std::ranges::partial_sort_copy_result<int, int>, std::ranges::in_out_result<int, int>>);
 
-template <class Iter, class Sent, class OutIter, class OutSent, size_t N>
+template <class Iter, class Sent, class OutIter, class OutSent, std::size_t N>
 constexpr void test_one(
-    std::array<int, N> input, size_t input_size, size_t output_size, std::array<int, N> sorted) {
+    std::array<int, N> input, std::size_t input_size, size_t output_size, std::array<int, N> sorted) {
   assert(input_size <= N);
   assert(output_size <= N + 1); // To support testing the case where output size exceeds input size.
 
   using ResultT = std::ranges::partial_sort_copy_result<Iter, OutIter>;
   // To support testing the case where output size exceeds input size; also makes sure calling `out.data() + int()` is
   // valid.
-  constexpr size_t OutputSize = N + 1;
-  size_t result_size = std::ranges::min(input_size, output_size);
+  constexpr std::size_t OutputSize = N + 1;
+  std::size_t result_size = std::ranges::min(input_size, output_size);
 
   auto begin = input.data();
   auto end = input.data() + input_size;
@@ -167,13 +167,13 @@ constexpr void test_one(
 
 }
 
-template <class Iter, class Sent, class OutIter, class OutSent, size_t N>
+template <class Iter, class Sent, class OutIter, class OutSent, std::size_t N>
 constexpr void test_all_subsequences(const std::array<int, N> input) {
   auto sorted = input;
   std::sort(sorted.begin(), sorted.end());
 
   // Whole input, increasing output size. Also check the case when `output_size` exceeds input size.
-  for (size_t out_size = 0; out_size <= N + 1; ++out_size) {
+  for (std::size_t out_size = 0; out_size <= N + 1; ++out_size) {
     test_one<Iter, Sent, OutIter, OutSent>(input, N, out_size, sorted);
   }
 }

diff  --git a/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort/ranges_partial_sort.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort/ranges_partial_sort.pass.cpp
index e70828f055f89..af304662599ca 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort/ranges_partial_sort.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort/ranges_partial_sort.pass.cpp
@@ -62,8 +62,8 @@ static_assert(!HasPartialSortR<UncheckedRange<int*, SentinelForNotWeaklyEquality
 static_assert(!HasPartialSortR<UncheckedRange<int*>, BadComparator>);
 static_assert(!HasPartialSortR<UncheckedRange<const int*>>); // Doesn't satisfy `sortable`.
 
-template <class Iter, class Sent, size_t N>
-constexpr void test_one(std::array<int, N> input, size_t mid_index, std::array<int, N> sorted) {
+template <class Iter, class Sent, std::size_t N>
+constexpr void test_one(std::array<int, N> input, std::size_t mid_index, std::array<int, N> sorted) {
   { // (iterator, sentinel) overload.
     auto partially_sorted = input;
     auto begin = Iter(partially_sorted.data());
@@ -89,12 +89,12 @@ constexpr void test_one(std::array<int, N> input, size_t mid_index, std::array<i
   }
 }
 
-template <class Iter, class Sent, size_t N>
+template <class Iter, class Sent, std::size_t N>
 constexpr void test_all_subsequences(std::array<int, N> input) {
   auto sorted = input;
   std::sort(sorted.begin(), sorted.end());
 
-  for (size_t n = 0; n <= N; ++n) {
+  for (std::size_t n = 0; n <= N; ++n) {
     test_one<Iter, Sent, N>(input, n, sorted);
   }
 }

diff  --git a/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/ranges.sort.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/ranges.sort.pass.cpp
index 96f4c1c2f5736..2463bf733196d 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/ranges.sort.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/ranges.sort.pass.cpp
@@ -58,7 +58,7 @@ static_assert(!HasSortR<UncheckedRange<int*, SentinelForNotWeaklyEqualityCompara
 static_assert(!HasSortR<UncheckedRange<int*>, BadComparator>);
 static_assert(!HasSortR<UncheckedRange<const int*>>); // Doesn't satisfy `sortable`.
 
-template <class Iter, class Sent, size_t N>
+template <class Iter, class Sent, std::size_t N>
 constexpr void test_one(std::array<int, N> input, std::array<int, N> expected) {
   { // (iterator, sentinel) overload.
     auto sorted = input;

diff  --git a/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/ranges.stable.sort.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/ranges.stable.sort.pass.cpp
index f83d093c12a8b..ea0a3ebdf85b2 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/ranges.stable.sort.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/ranges.stable.sort.pass.cpp
@@ -57,7 +57,7 @@ static_assert(!HasStableSortR<UncheckedRange<int*, SentinelForNotWeaklyEqualityC
 static_assert(!HasStableSortR<UncheckedRange<int*>, BadComparator>);
 static_assert(!HasStableSortR<UncheckedRange<const int*>>); // Doesn't satisfy `sortable`.
 
-template <class Iter, class Sent, size_t N>
+template <class Iter, class Sent, std::size_t N>
 void test_one(std::array<int, N> input, std::array<int, N> expected) {
   { // (iterator, sentinel) overload.
     auto sorted = input;

diff  --git a/libcxx/test/std/algorithms/alg.sorting/sortable_helpers.h b/libcxx/test/std/algorithms/alg.sorting/sortable_helpers.h
index 31385bdea05ad..d8cc781bfe913 100644
--- a/libcxx/test/std/algorithms/alg.sorting/sortable_helpers.h
+++ b/libcxx/test/std/algorithms/alg.sorting/sortable_helpers.h
@@ -9,6 +9,7 @@
 #ifndef SORTABLE_HELPERS_H
 #define SORTABLE_HELPERS_H
 
+#include <cstddef>
 #include <type_traits>
 
 #include "test_macros.h"
@@ -108,7 +109,7 @@ struct TracedCopy {
 template <class Iter>
 struct NonBorrowedRange {
   int* data_;
-  size_t size_;
+  std::size_t size_;
 
   // TODO: some algorithms calls std::__copy
   // std::__copy(contiguous_iterator<int*>, sentinel_wrapper<contiguous_iterator<int*>>, contiguous_iterator<int*>) doesn't seem to work.
@@ -116,7 +117,7 @@ struct NonBorrowedRange {
   // sentinel_wrapper<contiguous_iterator<int*>>
   using Sent = std::conditional_t<std::contiguous_iterator<Iter>, Iter, sentinel_wrapper<Iter>>;
 
-  constexpr NonBorrowedRange(int* d, size_t s) : data_{d}, size_{s} {}
+  constexpr NonBorrowedRange(int* d, std::size_t s) : data_{d}, size_{s} {}
 
   constexpr Iter begin() const { return Iter{data_}; };
   constexpr Sent end() const { return Sent{Iter{data_ + size_}}; };

diff  --git a/libcxx/test/std/algorithms/ranges_robust_against_dangling.pass.cpp b/libcxx/test/std/algorithms/ranges_robust_against_dangling.pass.cpp
index b19f42f2a4079..c71b57ebb1fb6 100644
--- a/libcxx/test/std/algorithms/ranges_robust_against_dangling.pass.cpp
+++ b/libcxx/test/std/algorithms/ranges_robust_against_dangling.pass.cpp
@@ -29,9 +29,9 @@ struct NonBorrowedRange {
   using Sent = sentinel_wrapper<Iter>;
 
   int* data_;
-  size_t size_;
+  std::size_t size_;
 
-  template <size_t N>
+  template <std::size_t N>
   constexpr explicit NonBorrowedRange(std::array<int, N>& arr) : data_{arr.data()}, size_{arr.size()} {}
 
   constexpr Iter begin() const { return data_; };
@@ -109,7 +109,7 @@ constexpr bool test_all() {
   auto out2 = output.begin() + 1;
 
   int x = 2;
-  size_t count = 1;
+  std::size_t count = 1;
 
   dangling_1st(std::ranges::find, in, x);
   dangling_1st(std::ranges::find_if, in, unary_pred);

diff  --git a/libcxx/test/std/algorithms/ranges_robust_against_omitting_invoke.pass.cpp b/libcxx/test/std/algorithms/ranges_robust_against_omitting_invoke.pass.cpp
index 35b9f928b739f..c5e8502ef2de6 100644
--- a/libcxx/test/std/algorithms/ranges_robust_against_omitting_invoke.pass.cpp
+++ b/libcxx/test/std/algorithms/ranges_robust_against_omitting_invoke.pass.cpp
@@ -69,7 +69,7 @@ constexpr bool test_all() {
   Bar c{Foo{3}};
 
   Foo x{2};
-  size_t count = 1;
+  std::size_t count = 1;
 
   test(std::ranges::any_of, in, &Foo::unary_pred, &Bar::val);
   test(std::ranges::all_of, in, &Foo::unary_pred, &Bar::val);

diff  --git a/libcxx/test/std/algorithms/robust_against_adl_on_new.pass.cpp b/libcxx/test/std/algorithms/robust_against_adl_on_new.pass.cpp
index 5dcfde3735b96..6bd2abded2463 100644
--- a/libcxx/test/std/algorithms/robust_against_adl_on_new.pass.cpp
+++ b/libcxx/test/std/algorithms/robust_against_adl_on_new.pass.cpp
@@ -19,7 +19,7 @@ struct A {
     static bool isEven(const A& a) { return a.i % 2 == 0; }
 };
 
-void *operator new(size_t, A*) = delete;
+void *operator new(std::size_t, A*) = delete;
 
 int main(int, char**)
 {

diff  --git a/libcxx/test/std/algorithms/robust_against_proxy_iterators_lifetime_bugs.pass.cpp b/libcxx/test/std/algorithms/robust_against_proxy_iterators_lifetime_bugs.pass.cpp
index 166806e60c77f..3a15d255dc246 100644
--- a/libcxx/test/std/algorithms/robust_against_proxy_iterators_lifetime_bugs.pass.cpp
+++ b/libcxx/test/std/algorithms/robust_against_proxy_iterators_lifetime_bugs.pass.cpp
@@ -547,15 +547,15 @@ class ConstexprIterator {
 
 #endif // TEST_STD_VER > 17
 
-template <class T, size_t N = 32>
+template <class T, std::size_t N = 32>
 class Input {
   using Array = std::array<T, N>;
 
-  size_t size_ = 0;
+  std::size_t size_ = 0;
   Array values_ = {};
 
 public:
-  template <size_t N2>
+  template <std::size_t N2>
   TEST_CONSTEXPR_CXX20 Input(std::array<T, N2> from) {
     static_assert(N2 <= N, "");
 
@@ -565,7 +565,7 @@ class Input {
 
   TEST_CONSTEXPR_CXX20 typename Array::iterator begin() { return values_.begin(); }
   TEST_CONSTEXPR_CXX20 typename Array::iterator end() { return values_.begin() + size_; }
-  TEST_CONSTEXPR_CXX20 size_t size() const { return size_; }
+  TEST_CONSTEXPR_CXX20 std::size_t size() const { return size_; }
 };
 
 // TODO: extend `Value` and `Reference` so that it's possible to pass plain integers to all the algorithms.
@@ -624,14 +624,14 @@ TEST_CONSTEXPR_CXX20 std::array<Input<typename Iter::value_type>, 8> get_sort_te
   return result;
 }
 
-template <class Input, size_t N, class Func>
+template <class Input, std::size_t N, class Func>
 TEST_CONSTEXPR_CXX20 void test(std::array<Input, N> inputs, Func func) {
   for (auto&& in : inputs) {
     func(in.begin(), in.end());
   }
 }
 
-template <class Input, size_t N, class Func>
+template <class Input, std::size_t N, class Func>
 TEST_CONSTEXPR_CXX20 void test_n(std::array<Input, N> inputs, Func func) {
   for (auto&& in : inputs) {
     func(in.begin(), in.size());
@@ -698,17 +698,17 @@ TEST_CONSTEXPR_CXX20 bool test() {
   // TODO: is_permutation
   test(simple_in, [&](I b, I e) { (void) std::for_each(b, e, is_neg); });
 #if TEST_STD_VER > 14
-  test_n(simple_in, [&](I b, size_t n) { (void) std::for_each_n(b, n, is_neg); });
+  test_n(simple_in, [&](I b, std::size_t n) { (void) std::for_each_n(b, n, is_neg); });
 #endif
   test(simple_in, [&](I b, I e) { (void) std::copy(b, e, out); });
-  test_n(simple_in, [&](I b, size_t n) { (void) std::copy_n(b, n, out); });
+  test_n(simple_in, [&](I b, std::size_t n) { (void) std::copy_n(b, n, out); });
   test(simple_in, [&](I b, I e) { (void) std::copy_backward(b, e, out + N); });
   test(simple_in, [&](I b, I e) { (void) std::copy_if(b, e, out, is_neg); });
   test(simple_in, [&](I b, I e) { (void) std::move(b, e, out); });
   test(simple_in, [&](I b, I e) { (void) std::move_backward(b, e, out + N); });
   test(simple_in, [&](I b, I e) { (void) std::transform(b, e, out, identity); });
   test(simple_in, [&](I b, I e) { (void) std::generate(b, e, gen); });
-  test_n(simple_in, [&](I b, size_t n) { (void) std::generate_n(b, n, gen); });
+  test_n(simple_in, [&](I b, std::size_t n) { (void) std::generate_n(b, n, gen); });
   test(simple_in, [&](I b, I e) { (void) std::remove_copy(b, e, out, x); });
   test(simple_in, [&](I b, I e) { (void) std::remove_copy_if(b, e, out, is_neg); });
   test(simple_in, [&](I b, I e) { (void) std::replace(b, e, x, y); });

diff  --git a/libcxx/test/std/atomics/stdatomic.h.syn/types.compile.pass.cpp b/libcxx/test/std/atomics/stdatomic.h.syn/types.compile.pass.cpp
index 5d0a2859bfcdc..84f49a76a810f 100644
--- a/libcxx/test/std/atomics/stdatomic.h.syn/types.compile.pass.cpp
+++ b/libcxx/test/std/atomics/stdatomic.h.syn/types.compile.pass.cpp
@@ -202,7 +202,7 @@ void f() {
 
   static_assert(std::is_same_v<std::atomic<intptr_t>,  ::atomic_intptr_t>);
   static_assert(std::is_same_v<std::atomic<uintptr_t>, ::atomic_uintptr_t>);
-  static_assert(std::is_same_v<std::atomic<size_t>,    ::atomic_size_t>);
+  static_assert(std::is_same_v<std::atomic<std::size_t>,    ::atomic_size_t>);
   static_assert(std::is_same_v<std::atomic<ptr
diff _t>, ::atomic_ptr
diff _t>);
   static_assert(std::is_same_v<std::atomic<intmax_t>,  ::atomic_intmax_t>);
   static_assert(std::is_same_v<std::atomic<uintmax_t>, ::atomic_uintmax_t>);

diff  --git a/libcxx/test/std/atomics/types.pass.cpp b/libcxx/test/std/atomics/types.pass.cpp
index ee5cca2237745..e0b617071c04f 100644
--- a/libcxx/test/std/atomics/types.pass.cpp
+++ b/libcxx/test/std/atomics/types.pass.cpp
@@ -148,7 +148,7 @@ int main(int, char**)
 
     test<intptr_t>  ();
     test<uintptr_t> ();
-    test<size_t>    ();
+    test<std::size_t>    ();
     test<ptr
diff _t> ();
     test<intmax_t>  ();
     test<uintmax_t> ();

diff  --git a/libcxx/test/std/containers/associative/map/map.access/max_size.pass.cpp b/libcxx/test/std/containers/associative/map/map.access/max_size.pass.cpp
index b38cf11463897..e10f20359bb18 100644
--- a/libcxx/test/std/containers/associative/map/map.access/max_size.pass.cpp
+++ b/libcxx/test/std/containers/associative/map/map.access/max_size.pass.cpp
@@ -31,7 +31,7 @@ int main(int, char**)
     LIBCPP_ASSERT(c.max_size() == 10);
   }
   {
-    typedef limited_allocator<KV, (size_t)-1> A;
+    typedef limited_allocator<KV, (std::size_t)-1> A;
     typedef std::map<int, int, std::less<int>, A> C;
     const C::size_type max_dist =
         static_cast<C::size_type>(std::numeric_limits<C::
diff erence_type>::max());

diff  --git a/libcxx/test/std/containers/associative/map/map.cons/copy_assign.pass.cpp b/libcxx/test/std/containers/associative/map/map.cons/copy_assign.pass.cpp
index 3fd051f790619..c8201e2899711 100644
--- a/libcxx/test/std/containers/associative/map/map.cons/copy_assign.pass.cpp
+++ b/libcxx/test/std/containers/associative/map/map.cons/copy_assign.pass.cpp
@@ -42,12 +42,12 @@ class counting_allocatorT {
     template <class U> bool operator==(const counting_allocatorT<U>& other) const noexcept { return foo == other.foo; }
     template <class U> bool operator!=(const counting_allocatorT<U>& other) const noexcept { return foo != other.foo; }
 
-    T* allocate(size_t n) const {
+    T* allocate(std::size_t n) const {
         ca_allocs.push_back(foo);
         void * const pv = ::malloc(n * sizeof(T));
         return static_cast<T *>(pv);
     }
-    void deallocate(T* p, size_t) const noexcept {
+    void deallocate(T* p, std::size_t) const noexcept {
         ca_deallocs.push_back(foo);
         free(p);
     }
@@ -65,12 +65,12 @@ class counting_allocatorF {
     template <class U> bool operator==(const counting_allocatorF<U>& other) const noexcept { return foo == other.foo; }
     template <class U> bool operator!=(const counting_allocatorF<U>& other) const noexcept { return foo != other.foo; }
 
-    T* allocate(size_t n) const {
+    T* allocate(std::size_t n) const {
         ca_allocs.push_back(foo);
         void * const pv = ::malloc(n * sizeof(T));
         return static_cast<T *>(pv);
     }
-    void deallocate(T* p, size_t) const noexcept {
+    void deallocate(T* p, std::size_t) const noexcept {
         ca_deallocs.push_back(foo);
         free(p);
     }

diff  --git a/libcxx/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp b/libcxx/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp
index bcfafe86449c3..63630164b2e64 100644
--- a/libcxx/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp
+++ b/libcxx/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp
@@ -166,7 +166,7 @@ int main(int, char**)
                 V(3, 2),
                 V(3, 3)
             };
-            const size_t num = sizeof(a1)/sizeof(a1[0]);
+            const std::size_t num = sizeof(a1)/sizeof(a1[0]);
             assert(Counter_base::gConstructed == num);
 
             M m1(I(a1), I(a1+num), C(), A());

diff  --git a/libcxx/test/std/containers/associative/map/map.erasure/erase_if.pass.cpp b/libcxx/test/std/containers/associative/map/map.erasure/erase_if.pass.cpp
index ee55466244407..6dfbbfea848af 100644
--- a/libcxx/test/std/containers/associative/map/map.erasure/erase_if.pass.cpp
+++ b/libcxx/test/std/containers/associative/map/map.erasure/erase_if.pass.cpp
@@ -30,7 +30,7 @@ M make (Init vals)
 }
 
 template <typename M, typename Pred>
-void test0(Init vals, Pred p, Init expected, size_t expected_erased_count) {
+void test0(Init vals, Pred p, Init expected, std::size_t expected_erased_count) {
   M s = make<M>(vals);
   ASSERT_SAME_TYPE(typename M::size_type, decltype(std::erase_if(s, p)));
   assert(expected_erased_count == std::erase_if(s, p));

diff  --git a/libcxx/test/std/containers/associative/map/map.modifiers/extract_iterator.pass.cpp b/libcxx/test/std/containers/associative/map/map.modifiers/extract_iterator.pass.cpp
index b036531a0efce..6cdfac774a2c3 100644
--- a/libcxx/test/std/containers/associative/map/map.modifiers/extract_iterator.pass.cpp
+++ b/libcxx/test/std/containers/associative/map/map.modifiers/extract_iterator.pass.cpp
@@ -22,7 +22,7 @@
 template <class Container>
 void test(Container& c)
 {
-    size_t sz = c.size();
+    std::size_t sz = c.size();
 
     auto some_key = c.cbegin()->first;
 

diff  --git a/libcxx/test/std/containers/associative/map/map.modifiers/extract_key.pass.cpp b/libcxx/test/std/containers/associative/map/map.modifiers/extract_key.pass.cpp
index 80e7e1fc69c7d..c0ffa343497e2 100644
--- a/libcxx/test/std/containers/associative/map/map.modifiers/extract_key.pass.cpp
+++ b/libcxx/test/std/containers/associative/map/map.modifiers/extract_key.pass.cpp
@@ -22,8 +22,8 @@
 template <class Container, class KeyTypeIter>
 void test(Container& c, KeyTypeIter first, KeyTypeIter last)
 {
-    size_t sz = c.size();
-    assert((size_t)std::distance(first, last) == sz);
+    std::size_t sz = c.size();
+    assert((std::size_t)std::distance(first, last) == sz);
 
     for (KeyTypeIter copy = first; copy != last; ++copy)
     {

diff  --git a/libcxx/test/std/containers/associative/map/map.modifiers/insert_node_type_hint.pass.cpp b/libcxx/test/std/containers/associative/map/map.modifiers/insert_node_type_hint.pass.cpp
index 1d09443255a3d..3ef005480e8c2 100644
--- a/libcxx/test/std/containers/associative/map/map.modifiers/insert_node_type_hint.pass.cpp
+++ b/libcxx/test/std/containers/associative/map/map.modifiers/insert_node_type_hint.pass.cpp
@@ -38,7 +38,7 @@ void test(Container& c)
     {
         typename Container::node_type node = nf(i, i + 1);
         assert(!node.empty());
-        size_t prev = c.size();
+        std::size_t prev = c.size();
         auto it = c.insert(c.end(), std::move(node));
         assert(node.empty());
         assert(prev + 1 == c.size());

diff  --git a/libcxx/test/std/containers/associative/multimap/max_size.pass.cpp b/libcxx/test/std/containers/associative/multimap/max_size.pass.cpp
index a4537c3d1b297..f7b8b5e071be9 100644
--- a/libcxx/test/std/containers/associative/multimap/max_size.pass.cpp
+++ b/libcxx/test/std/containers/associative/multimap/max_size.pass.cpp
@@ -31,7 +31,7 @@ int main(int, char**)
     LIBCPP_ASSERT(c.max_size() == 10);
   }
   {
-    typedef limited_allocator<KV, (size_t)-1> A;
+    typedef limited_allocator<KV, (std::size_t)-1> A;
     typedef std::multimap<int, int, std::less<int>, A> C;
     const C::size_type max_dist =
         static_cast<C::size_type>(std::numeric_limits<C::
diff erence_type>::max());

diff  --git a/libcxx/test/std/containers/associative/multimap/multimap.cons/move_alloc.pass.cpp b/libcxx/test/std/containers/associative/multimap/multimap.cons/move_alloc.pass.cpp
index a4edd473c6294..e246842ea7d4e 100644
--- a/libcxx/test/std/containers/associative/multimap/multimap.cons/move_alloc.pass.cpp
+++ b/libcxx/test/std/containers/associative/multimap/multimap.cons/move_alloc.pass.cpp
@@ -165,7 +165,7 @@ int main(int, char**)
                 V(3, 2),
                 V(3, 3)
             };
-            const size_t num = sizeof(a1)/sizeof(a1[0]);
+            const std::size_t num = sizeof(a1)/sizeof(a1[0]);
             assert(Counter_base::gConstructed == num);
 
             M m1(I(a1), I(a1+num), C(), A());

diff  --git a/libcxx/test/std/containers/associative/multimap/multimap.erasure/erase_if.pass.cpp b/libcxx/test/std/containers/associative/multimap/multimap.erasure/erase_if.pass.cpp
index f270c4e9f9355..89ab932f47b00 100644
--- a/libcxx/test/std/containers/associative/multimap/multimap.erasure/erase_if.pass.cpp
+++ b/libcxx/test/std/containers/associative/multimap/multimap.erasure/erase_if.pass.cpp
@@ -30,7 +30,7 @@ M make (Init vals)
 }
 
 template <typename M, typename Pred>
-void test0(Init vals, Pred p, Init expected, size_t expected_erased_count) {
+void test0(Init vals, Pred p, Init expected, std::size_t expected_erased_count) {
   M s = make<M>(vals);
   ASSERT_SAME_TYPE(typename M::size_type, decltype(std::erase_if(s, p)));
   assert(expected_erased_count == std::erase_if(s, p));

diff  --git a/libcxx/test/std/containers/associative/multimap/multimap.modifiers/extract_iterator.pass.cpp b/libcxx/test/std/containers/associative/multimap/multimap.modifiers/extract_iterator.pass.cpp
index c5f5b4d095905..c4751d81ec953 100644
--- a/libcxx/test/std/containers/associative/multimap/multimap.modifiers/extract_iterator.pass.cpp
+++ b/libcxx/test/std/containers/associative/multimap/multimap.modifiers/extract_iterator.pass.cpp
@@ -22,7 +22,7 @@
 template <class Container>
 void test(Container& c)
 {
-    size_t sz = c.size();
+    std::size_t sz = c.size();
 
     auto some_key = c.cbegin()->first;
 

diff  --git a/libcxx/test/std/containers/associative/multimap/multimap.modifiers/extract_key.pass.cpp b/libcxx/test/std/containers/associative/multimap/multimap.modifiers/extract_key.pass.cpp
index 891e78cdc4915..b558f4e3f1207 100644
--- a/libcxx/test/std/containers/associative/multimap/multimap.modifiers/extract_key.pass.cpp
+++ b/libcxx/test/std/containers/associative/multimap/multimap.modifiers/extract_key.pass.cpp
@@ -22,8 +22,8 @@
 template <class Container, class KeyTypeIter>
 void test(Container& c, KeyTypeIter first, KeyTypeIter last)
 {
-    size_t sz = c.size();
-    assert((size_t)std::distance(first, last) == sz);
+    std::size_t sz = c.size();
+    assert((std::size_t)std::distance(first, last) == sz);
 
     for (KeyTypeIter copy = first; copy != last; ++copy)
     {

diff  --git a/libcxx/test/std/containers/associative/multimap/multimap.modifiers/insert_node_type_hint.pass.cpp b/libcxx/test/std/containers/associative/multimap/multimap.modifiers/insert_node_type_hint.pass.cpp
index d4ba115a3fe23..68e6b8b795f9d 100644
--- a/libcxx/test/std/containers/associative/multimap/multimap.modifiers/insert_node_type_hint.pass.cpp
+++ b/libcxx/test/std/containers/associative/multimap/multimap.modifiers/insert_node_type_hint.pass.cpp
@@ -37,7 +37,7 @@ void test(Container& c)
     {
         typename Container::node_type node = nf(i, i + 1);
         assert(!node.empty());
-        size_t prev = c.size();
+        std::size_t prev = c.size();
         auto it = c.insert(c.end(), std::move(node));
         assert(node.empty());
         assert(prev + 1 == c.size());

diff  --git a/libcxx/test/std/containers/associative/multiset/extract_iterator.pass.cpp b/libcxx/test/std/containers/associative/multiset/extract_iterator.pass.cpp
index bce568ece6a18..ac8c5e3b3d459 100644
--- a/libcxx/test/std/containers/associative/multiset/extract_iterator.pass.cpp
+++ b/libcxx/test/std/containers/associative/multiset/extract_iterator.pass.cpp
@@ -22,7 +22,7 @@
 template <class Container>
 void test(Container& c)
 {
-    size_t sz = c.size();
+    std::size_t sz = c.size();
 
     for (auto first = c.cbegin(); first != c.cend();)
     {

diff  --git a/libcxx/test/std/containers/associative/multiset/extract_key.pass.cpp b/libcxx/test/std/containers/associative/multiset/extract_key.pass.cpp
index d92d4ed9bf2a9..bad5d1bb3d394 100644
--- a/libcxx/test/std/containers/associative/multiset/extract_key.pass.cpp
+++ b/libcxx/test/std/containers/associative/multiset/extract_key.pass.cpp
@@ -22,8 +22,8 @@
 template <class Container, class KeyTypeIter>
 void test(Container& c, KeyTypeIter first, KeyTypeIter last)
 {
-    size_t sz = c.size();
-    assert((size_t)std::distance(first, last) == sz);
+    std::size_t sz = c.size();
+    assert((std::size_t)std::distance(first, last) == sz);
 
     for (KeyTypeIter copy = first; copy != last; ++copy)
     {

diff  --git a/libcxx/test/std/containers/associative/multiset/insert_node_type_hint.pass.cpp b/libcxx/test/std/containers/associative/multiset/insert_node_type_hint.pass.cpp
index 00d0b67eea496..e5c628e8509bc 100644
--- a/libcxx/test/std/containers/associative/multiset/insert_node_type_hint.pass.cpp
+++ b/libcxx/test/std/containers/associative/multiset/insert_node_type_hint.pass.cpp
@@ -36,7 +36,7 @@ void test(Container& c)
     {
         typename Container::node_type node = nf(i);
         assert(!node.empty());
-        size_t prev = c.size();
+        std::size_t prev = c.size();
         auto it = c.insert(c.end(), std::move(node));
         assert(prev + 1 == c.size());
         assert(*it == i);

diff  --git a/libcxx/test/std/containers/associative/multiset/max_size.pass.cpp b/libcxx/test/std/containers/associative/multiset/max_size.pass.cpp
index 5986df295545a..09faf8f9b97e6 100644
--- a/libcxx/test/std/containers/associative/multiset/max_size.pass.cpp
+++ b/libcxx/test/std/containers/associative/multiset/max_size.pass.cpp
@@ -30,7 +30,7 @@ int main(int, char**)
       LIBCPP_ASSERT(c.max_size() == 10);
     }
     {
-      typedef limited_allocator<int, (size_t)-1> A;
+      typedef limited_allocator<int, (std::size_t)-1> A;
       typedef std::multiset<int, std::less<int>, A> C;
       const C::size_type max_dist =
           static_cast<C::size_type>(std::numeric_limits<C::
diff erence_type>::max());

diff  --git a/libcxx/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp b/libcxx/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp
index d279dba40a197..090be76483be2 100644
--- a/libcxx/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp
+++ b/libcxx/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp
@@ -160,7 +160,7 @@ int main(int, char**)
             V(3),
             V(3)
             };
-            const size_t num = sizeof(a1)/sizeof(a1[0]);
+            const std::size_t num = sizeof(a1)/sizeof(a1[0]);
             assert(Counter_base::gConstructed == num);
 
             M m1(I(a1), I(a1+num), C(), A());

diff  --git a/libcxx/test/std/containers/associative/multiset/multiset.erasure/erase_if.pass.cpp b/libcxx/test/std/containers/associative/multiset/multiset.erasure/erase_if.pass.cpp
index f39797551b7e9..476f4f54e28e1 100644
--- a/libcxx/test/std/containers/associative/multiset/multiset.erasure/erase_if.pass.cpp
+++ b/libcxx/test/std/containers/associative/multiset/multiset.erasure/erase_if.pass.cpp
@@ -20,7 +20,7 @@
 #include "min_allocator.h"
 
 template <class S, class Pred>
-void test0(S s, Pred p, S expected, size_t expected_erased_count) {
+void test0(S s, Pred p, S expected, std::size_t expected_erased_count) {
   ASSERT_SAME_TYPE(typename S::size_type, decltype(std::erase_if(s, p)));
   assert(expected_erased_count == std::erase_if(s, p));
   assert(s == expected);

diff  --git a/libcxx/test/std/containers/associative/set/extract_iterator.pass.cpp b/libcxx/test/std/containers/associative/set/extract_iterator.pass.cpp
index 91b97fcd92450..c6ef11301d7a6 100644
--- a/libcxx/test/std/containers/associative/set/extract_iterator.pass.cpp
+++ b/libcxx/test/std/containers/associative/set/extract_iterator.pass.cpp
@@ -22,7 +22,7 @@
 template <class Container>
 void test(Container& c)
 {
-    size_t sz = c.size();
+    std::size_t sz = c.size();
 
     for (auto first = c.cbegin(); first != c.cend();)
     {

diff  --git a/libcxx/test/std/containers/associative/set/extract_key.pass.cpp b/libcxx/test/std/containers/associative/set/extract_key.pass.cpp
index 90ebbb7bc56ce..f37665b4a2a28 100644
--- a/libcxx/test/std/containers/associative/set/extract_key.pass.cpp
+++ b/libcxx/test/std/containers/associative/set/extract_key.pass.cpp
@@ -22,8 +22,8 @@
 template <class Container, class KeyTypeIter>
 void test(Container& c, KeyTypeIter first, KeyTypeIter last)
 {
-    size_t sz = c.size();
-    assert((size_t)std::distance(first, last) == sz);
+    std::size_t sz = c.size();
+    assert((std::size_t)std::distance(first, last) == sz);
 
     for (KeyTypeIter copy = first; copy != last; ++copy)
     {

diff  --git a/libcxx/test/std/containers/associative/set/insert_node_type_hint.pass.cpp b/libcxx/test/std/containers/associative/set/insert_node_type_hint.pass.cpp
index d58cbe3a27c9d..6f4cbe97e2ab6 100644
--- a/libcxx/test/std/containers/associative/set/insert_node_type_hint.pass.cpp
+++ b/libcxx/test/std/containers/associative/set/insert_node_type_hint.pass.cpp
@@ -37,7 +37,7 @@ void test(Container& c)
     {
         typename Container::node_type node = nf(i);
         assert(!node.empty());
-        size_t prev = c.size();
+        std::size_t prev = c.size();
         auto it = c.insert(c.end(), std::move(node));
         assert(node.empty());
         assert(prev + 1 == c.size());

diff  --git a/libcxx/test/std/containers/associative/set/max_size.pass.cpp b/libcxx/test/std/containers/associative/set/max_size.pass.cpp
index e37bfe7142b06..f921378df21d1 100644
--- a/libcxx/test/std/containers/associative/set/max_size.pass.cpp
+++ b/libcxx/test/std/containers/associative/set/max_size.pass.cpp
@@ -30,7 +30,7 @@ int main(int, char**)
       LIBCPP_ASSERT(c.max_size() == 10);
     }
     {
-      typedef limited_allocator<int, (size_t)-1> A;
+      typedef limited_allocator<int, (std::size_t)-1> A;
       typedef std::set<int, std::less<int>, A> C;
       const C::size_type max_dist =
           static_cast<C::size_type>(std::numeric_limits<C::
diff erence_type>::max());

diff  --git a/libcxx/test/std/containers/associative/set/set.cons/move_alloc.pass.cpp b/libcxx/test/std/containers/associative/set/set.cons/move_alloc.pass.cpp
index 59d536ef5c7a0..886cad9fa2123 100644
--- a/libcxx/test/std/containers/associative/set/set.cons/move_alloc.pass.cpp
+++ b/libcxx/test/std/containers/associative/set/set.cons/move_alloc.pass.cpp
@@ -160,7 +160,7 @@ int main(int, char**)
             V(3),
             V(3)
             };
-            const size_t num = sizeof(a1)/sizeof(a1[0]);
+            const std::size_t num = sizeof(a1)/sizeof(a1[0]);
             assert(Counter_base::gConstructed == num);
 
             M m1(I(a1), I(a1+num), C(), A());

diff  --git a/libcxx/test/std/containers/associative/set/set.erasure/erase_if.pass.cpp b/libcxx/test/std/containers/associative/set/set.erasure/erase_if.pass.cpp
index 4c9095562a5f7..2e0f026376ac5 100644
--- a/libcxx/test/std/containers/associative/set/set.erasure/erase_if.pass.cpp
+++ b/libcxx/test/std/containers/associative/set/set.erasure/erase_if.pass.cpp
@@ -20,7 +20,7 @@
 #include "min_allocator.h"
 
 template <class S, class Pred>
-void test0(S s, Pred p, S expected, size_t expected_erased_count) {
+void test0(S s, Pred p, S expected, std::size_t expected_erased_count) {
   ASSERT_SAME_TYPE(typename S::size_type, decltype(std::erase_if(s, p)));
   assert(expected_erased_count == std::erase_if(s, p));
   assert(s == expected);

diff  --git a/libcxx/test/std/containers/check_consecutive.h b/libcxx/test/std/containers/check_consecutive.h
index 5f549c6c4ec27..0fe46e7f19557 100644
--- a/libcxx/test/std/containers/check_consecutive.h
+++ b/libcxx/test/std/containers/check_consecutive.h
@@ -18,9 +18,9 @@
 
 // Check consecutive equal values in an unordered_multiset iterator
 template <typename Iter>
-void CheckConsecutiveValues(Iter pos, Iter end, typename Iter::value_type value, size_t count)
+void CheckConsecutiveValues(Iter pos, Iter end, typename Iter::value_type value, std::size_t count)
 {
-    for ( size_t i = 0; i < count; ++i )
+    for ( std::size_t i = 0; i < count; ++i )
     {
         assert(pos != end);
         assert(*pos == value);

diff  --git a/libcxx/test/std/containers/sequences/array/contiguous.pass.cpp b/libcxx/test/std/containers/sequences/array/contiguous.pass.cpp
index fec48b325e90e..85e6ed7ae9aee 100644
--- a/libcxx/test/std/containers/sequences/array/contiguous.pass.cpp
+++ b/libcxx/test/std/containers/sequences/array/contiguous.pass.cpp
@@ -19,7 +19,7 @@
 template <class Container>
 TEST_CONSTEXPR_CXX14 void assert_contiguous(Container const& c)
 {
-    for (size_t i = 0; i < c.size(); ++i)
+    for (std::size_t i = 0; i < c.size(); ++i)
         assert(*(c.begin() + i) == *(std::addressof(*c.begin()) + i));
 }
 

diff  --git a/libcxx/test/std/containers/sequences/array/size_and_alignment.pass.cpp b/libcxx/test/std/containers/sequences/array/size_and_alignment.pass.cpp
index 242215689a81a..6fbc844a11eac 100644
--- a/libcxx/test/std/containers/sequences/array/size_and_alignment.pass.cpp
+++ b/libcxx/test/std/containers/sequences/array/size_and_alignment.pass.cpp
@@ -25,12 +25,12 @@
 
 #include "test_macros.h"
 
-template <class T, size_t Size>
+template <class T, std::size_t Size>
 struct MyArray {
   T elems[Size];
 };
 
-template <class T, size_t Size>
+template <class T, std::size_t Size>
 void test() {
   typedef T CArrayT[Size == 0 ? 1 : Size];
   typedef std::array<T, Size> ArrayT;

diff  --git a/libcxx/test/std/containers/sequences/deque/abi.compile.pass.cpp b/libcxx/test/std/containers/sequences/deque/abi.compile.pass.cpp
index 36a76b2e11d61..37e87d59503ee 100644
--- a/libcxx/test/std/containers/sequences/deque/abi.compile.pass.cpp
+++ b/libcxx/test/std/containers/sequences/deque/abi.compile.pass.cpp
@@ -82,5 +82,5 @@ static_assert(TEST_ALIGNOF(std::deque<char, test_allocator<char> >) == 4, "");
 static_assert(TEST_ALIGNOF(std::deque<char, small_iter_allocator<char> >) == 2, "");
 
 #else
-#  error size_t has an unexpected size
+#  error std::size_t has an unexpected size
 #endif

diff  --git a/libcxx/test/std/containers/sequences/deque/deque.capacity/max_size.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.capacity/max_size.pass.cpp
index 230a46519b107..7e2f72eb1e7e0 100644
--- a/libcxx/test/std/containers/sequences/deque/deque.capacity/max_size.pass.cpp
+++ b/libcxx/test/std/containers/sequences/deque/deque.capacity/max_size.pass.cpp
@@ -27,7 +27,7 @@ int main(int, char**) {
     LIBCPP_ASSERT(c.max_size() == 10);
   }
   {
-    typedef limited_allocator<int, (size_t)-1> A;
+    typedef limited_allocator<int, (std::size_t)-1> A;
     typedef std::deque<int, A> C;
     const C::size_type max_dist =
         static_cast<C::size_type>(std::numeric_limits<C::
diff erence_type>::max());

diff  --git a/libcxx/test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp
index 5bb3dc99d1191..88672fa044fe2 100644
--- a/libcxx/test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp
@@ -27,7 +27,7 @@ struct some_alloc
 {
     typedef T value_type;
     some_alloc(const some_alloc&);
-    void allocate(size_t);
+    void allocate(std::size_t);
 };
 
 int main(int, char**)

diff  --git a/libcxx/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp
index 8dfcebd0e1d62..88fce25a1f7e3 100644
--- a/libcxx/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp
@@ -25,7 +25,7 @@ struct some_alloc
     typedef T value_type;
     some_alloc(const some_alloc&);
     ~some_alloc() noexcept(false);
-    void allocate(size_t);
+    void allocate(std::size_t);
 };
 
 int main(int, char**)

diff  --git a/libcxx/test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp
index a87c8e00ab2fb..cbefbf6dae912 100644
--- a/libcxx/test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp
@@ -29,7 +29,7 @@ struct some_alloc
 {
     typedef T value_type;
     some_alloc(const some_alloc&);
-    void allocate(size_t);
+    void allocate(std::size_t);
 };
 
 int main(int, char**)

diff  --git a/libcxx/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp
index d90dd810a499c..add19ec61c8cc 100644
--- a/libcxx/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp
@@ -27,7 +27,7 @@ struct some_alloc
 {
     typedef T value_type;
     some_alloc(const some_alloc&);
-    void allocate(size_t);
+    void allocate(std::size_t);
 };
 
 int main(int, char**)

diff  --git a/libcxx/test/std/containers/sequences/deque/deque.erasure/erase.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.erasure/erase.pass.cpp
index 4c5a14e82374b..656884a345fa1 100644
--- a/libcxx/test/std/containers/sequences/deque/deque.erasure/erase.pass.cpp
+++ b/libcxx/test/std/containers/sequences/deque/deque.erasure/erase.pass.cpp
@@ -21,7 +21,7 @@
 #include "min_allocator.h"
 
 template <class S, class U>
-void test0(S s, U val, S expected, size_t expected_erased_count) {
+void test0(S s, U val, S expected, std::size_t expected_erased_count) {
   ASSERT_SAME_TYPE(typename S::size_type, decltype(std::erase(s, val)));
   assert(expected_erased_count == std::erase(s, val));
   assert(s == expected);

diff  --git a/libcxx/test/std/containers/sequences/deque/deque.erasure/erase_if.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.erasure/erase_if.pass.cpp
index 7f6e4c5ed3c4b..57657e4b48c86 100644
--- a/libcxx/test/std/containers/sequences/deque/deque.erasure/erase_if.pass.cpp
+++ b/libcxx/test/std/containers/sequences/deque/deque.erasure/erase_if.pass.cpp
@@ -20,7 +20,7 @@
 #include "min_allocator.h"
 
 template <class S, class Pred>
-void test0(S s, Pred p, S expected, size_t expected_erased_count) {
+void test0(S s, Pred p, S expected, std::size_t expected_erased_count) {
   ASSERT_SAME_TYPE(typename S::size_type, decltype(std::erase_if(s, p)));
   assert(expected_erased_count == std::erase_if(s, p));
   assert(s == expected);

diff  --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.invalidation.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.invalidation.pass.cpp
index 4c82b51a06b4a..0ac48aaa33d7b 100644
--- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.invalidation.pass.cpp
+++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.invalidation.pass.cpp
@@ -21,7 +21,7 @@
 #include "test_macros.h"
 
 template <typename C>
-void del_at_start(C c, size_t num)
+void del_at_start(C c, std::size_t num)
 {
     typename C::iterator first = c.begin();
     typename C::iterator last  = first + num;
@@ -41,7 +41,7 @@ void del_at_start(C c, size_t num)
 }
 
 template <typename C>
-void del_at_end(C c, size_t num)
+void del_at_end(C c, std::size_t num)
 {
     typename C::iterator last  = c.end();
     typename C::iterator first = last - num;
@@ -69,7 +69,7 @@ int main(int, char**)
 
     while (queue.size() > 1)
     {
-        for (size_t i = 1; i < queue.size(); ++i)
+        for (std::size_t i = 1; i < queue.size(); ++i)
         {
             del_at_start(queue, i);
             del_at_end  (queue, i);

diff  --git a/libcxx/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp
index 4ce47f0374ce6..d6257b13aaaec 100644
--- a/libcxx/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp
@@ -34,7 +34,7 @@ struct some_alloc
 
     some_alloc() {}
     some_alloc(const some_alloc&);
-    void allocate(size_t);
+    void allocate(std::size_t);
     void deallocate(void*, unsigned) {}
 
     typedef std::true_type propagate_on_container_swap;
@@ -47,7 +47,7 @@ struct some_alloc2
 
     some_alloc2() {}
     some_alloc2(const some_alloc2&);
-    void allocate(size_t);
+    void allocate(std::size_t);
     void deallocate(void*, unsigned) {}
 
     typedef std::false_type propagate_on_container_swap;

diff  --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp
index 772a985eeb559..b131cc9cdcafc 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp
@@ -27,7 +27,7 @@ struct some_alloc
 {
     typedef T value_type;
     some_alloc(const some_alloc&);
-    void allocate(size_t);
+    void allocate(std::size_t);
 };
 
 int main(int, char**)

diff  --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp
index ae6fd62b60190..db8f0d22e62f7 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp
@@ -25,7 +25,7 @@ struct some_alloc
     typedef T value_type;
     some_alloc(const some_alloc&);
     ~some_alloc() noexcept(false);
-    void allocate(size_t);
+    void allocate(std::size_t);
 };
 
 int main(int, char**)

diff  --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp
index 63168c40ae6f5..f361e373d23ff 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp
@@ -29,7 +29,7 @@ struct some_alloc
 {
     typedef T value_type;
     some_alloc(const some_alloc&);
-    void allocate(size_t);
+    void allocate(std::size_t);
 };
 
 int main(int, char**)

diff  --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp
index edd3449b06785..f132f0ed0b25d 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp
@@ -27,7 +27,7 @@ struct some_alloc
 {
     typedef T value_type;
     some_alloc(const some_alloc&);
-    void allocate(size_t);
+    void allocate(std::size_t);
 };
 
 int main(int, char**)

diff  --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp
index ca3931d107d55..3c27a6dfa34f1 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp
@@ -37,8 +37,8 @@ int main(int, char**)
 {
     { // test that the ctor is explicit
       typedef std::forward_list<DefaultOnly> C;
-      static_assert((std::is_constructible<C, size_t>::value), "");
-      static_assert((!std::is_convertible<size_t, C>::value), "");
+      static_assert((std::is_constructible<C, std::size_t>::value), "");
+      static_assert((!std::is_convertible<std::size_t, C>::value), "");
     }
     {
         typedef DefaultOnly T;

diff  --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.erasure/erase.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.erasure/erase.pass.cpp
index e6eb6f426153a..df9aa4139f736 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.erasure/erase.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.erasure/erase.pass.cpp
@@ -21,7 +21,7 @@
 #include "min_allocator.h"
 
 template <class S, class U>
-void test0(S s, U val, S expected, size_t expected_erased_count) {
+void test0(S s, U val, S expected, std::size_t expected_erased_count) {
   ASSERT_SAME_TYPE(typename S::size_type, decltype(std::erase(s, val)));
   assert(expected_erased_count == std::erase(s, val));
   assert(s == expected);

diff  --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.erasure/erase_if.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.erasure/erase_if.pass.cpp
index 21de03aa4c622..756febd1a1f17 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.erasure/erase_if.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.erasure/erase_if.pass.cpp
@@ -20,7 +20,7 @@
 #include "min_allocator.h"
 
 template <class S, class Pred>
-void test0(S s, Pred p, S expected, size_t expected_erased_count) {
+void test0(S s, Pred p, S expected, std::size_t expected_erased_count) {
   ASSERT_SAME_TYPE(typename S::size_type, decltype(std::erase_if(s, p)));
   assert(expected_erased_count == std::erase_if(s, p));
   assert(s == expected);

diff  --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_lvalue.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_lvalue.pass.cpp
index cb30b03150353..6e73b2fd73726 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_lvalue.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_lvalue.pass.cpp
@@ -68,7 +68,7 @@ int main(int, char**) {
     c1.merge(c2);
     assert(c2.empty());
 
-    for (size_t i = 0; i < 3; ++i) {
+    for (std::size_t i = 0; i < 3; ++i) {
       assert(to[i] == *io[i]);
 #if TEST_STD_VER >= 11
       assert(to[i] == ro[i].get());

diff  --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_lvalue_pred.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_lvalue_pred.pass.cpp
index d8df4eb261f5b..fddf9f9dc0f46 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_lvalue_pred.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_lvalue_pred.pass.cpp
@@ -68,7 +68,7 @@ int main(int, char**) {
     c1.merge(c2, std::greater<T>());
     assert(c2.empty());
 
-    for (size_t i = 0; i < 3; ++i) {
+    for (std::size_t i = 0; i < 3; ++i) {
       assert(to[i] == *io[i]);
 #if TEST_STD_VER >= 11
       assert(to[i] == ro[i].get());

diff  --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_rvalue.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_rvalue.pass.cpp
index f6db68669b491..3a7a8744ad46a 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_rvalue.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_rvalue.pass.cpp
@@ -65,7 +65,7 @@ int main(int, char**) {
     c1.merge(std::move(c2));
     assert(c2.empty());
 
-    for (size_t i = 0; i < 3; ++i) {
+    for (std::size_t i = 0; i < 3; ++i) {
       assert(to[i] == *io[i]);
       assert(to[i] == ro[i].get());
       assert(to[i] == *po[i]);

diff  --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_rvalue_pred.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_rvalue_pred.pass.cpp
index 1b45946affbdf..f1ddbfb620d29 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_rvalue_pred.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_rvalue_pred.pass.cpp
@@ -65,7 +65,7 @@ int main(int, char**) {
     c1.merge(std::move(c2), std::greater<T>());
     assert(c2.empty());
 
-    for (size_t i = 0; i < 3; ++i) {
+    for (std::size_t i = 0; i < 3; ++i) {
       assert(to[i] == *io[i]);
       assert(to[i] == ro[i].get());
       assert(to[i] == *po[i]);

diff  --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/remove_if.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/remove_if.pass.cpp
index 7142c8afe77eb..7e26b8b48a82d 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/remove_if.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/remove_if.pass.cpp
@@ -120,7 +120,7 @@ int main(int, char**)
     int a2[] = {   2,    3, 5, 8, 11};
     std::forward_list<PredLWG526> c(a1, a1 + 7);
     do_remove_if(c, std::ref(c.front()), 2);
-    for (size_t i = 0; i < 5; ++i)
+    for (std::size_t i = 0; i < 5; ++i)
     {
         assert(!c.empty());
         assert(c.front() == a2[i]);

diff  --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/unique_pred.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/unique_pred.pass.cpp
index bfadd6febc017..aed12da1c6c4a 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/unique_pred.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/unique_pred.pass.cpp
@@ -105,7 +105,7 @@ int main(int, char**)
     int a2[] = {1,       2, 3, 5, 2, 11};
     std::forward_list<PredLWG526> c1(a1, a1 + 8);
     do_unique(c1, std::ref(c1.front()), 2);
-    for (size_t i = 0; i < 6; ++i)
+    for (std::size_t i = 0; i < 6; ++i)
     {
         assert(!c1.empty());
         assert(c1.front() == a2[i]);

diff  --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp
index e9450ecaa388d..b4568837a2e01 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp
@@ -35,7 +35,7 @@ struct some_alloc
 
     some_alloc() {}
     some_alloc(const some_alloc&);
-    void allocate(size_t);
+    void allocate(std::size_t);
     void deallocate(void*, unsigned) {}
 
     typedef std::true_type propagate_on_container_swap;
@@ -48,7 +48,7 @@ struct some_alloc2
 
     some_alloc2() {}
     some_alloc2(const some_alloc2&);
-    void allocate(size_t);
+    void allocate(std::size_t);
     void deallocate(void*, unsigned) {}
 
     typedef std::false_type propagate_on_container_swap;

diff  --git a/libcxx/test/std/containers/sequences/forwardlist/max_size.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/max_size.pass.cpp
index 08d21d641163f..c5145fde52af7 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/max_size.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/max_size.pass.cpp
@@ -28,7 +28,7 @@ int main(int, char**)
       LIBCPP_ASSERT(c.max_size() == 10);
     }
     {
-      typedef limited_allocator<int, (size_t)-1> A;
+      typedef limited_allocator<int, (std::size_t)-1> A;
       typedef std::forward_list<int, A> C;
       const C::size_type max_dist =
           static_cast<C::size_type>(std::numeric_limits<C::
diff erence_type>::max());

diff  --git a/libcxx/test/std/containers/sequences/list/list.capacity/max_size.pass.cpp b/libcxx/test/std/containers/sequences/list/list.capacity/max_size.pass.cpp
index 8560a6a87f05f..c39fefe1cb11f 100644
--- a/libcxx/test/std/containers/sequences/list/list.capacity/max_size.pass.cpp
+++ b/libcxx/test/std/containers/sequences/list/list.capacity/max_size.pass.cpp
@@ -27,7 +27,7 @@ int main(int, char**) {
     LIBCPP_ASSERT(c.max_size() == 10);
   }
   {
-    typedef limited_allocator<int, (size_t)-1> A;
+    typedef limited_allocator<int, (std::size_t)-1> A;
     typedef std::list<int, A> C;
     const C::size_type max_dist =
         static_cast<C::size_type>(std::numeric_limits<C::
diff erence_type>::max());

diff  --git a/libcxx/test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp
index d34efac592bf7..f21225777af5e 100644
--- a/libcxx/test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp
@@ -27,7 +27,7 @@ struct some_alloc
 {
     typedef T value_type;
     some_alloc(const some_alloc&);
-    void allocate(size_t);
+    void allocate(std::size_t);
 };
 
 int main(int, char**)

diff  --git a/libcxx/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp
index a6c9a83f32f0a..ae7e264c64a3a 100644
--- a/libcxx/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp
@@ -25,7 +25,7 @@ struct some_alloc
     typedef T value_type;
     some_alloc(const some_alloc&);
     ~some_alloc() noexcept(false);
-    void allocate(size_t);
+    void allocate(std::size_t);
 };
 
 int main(int, char**)

diff  --git a/libcxx/test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp
index daa2410d77df3..9df8413bb19c4 100644
--- a/libcxx/test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp
@@ -29,7 +29,7 @@ struct some_alloc
 {
     typedef T value_type;
     some_alloc(const some_alloc&);
-    void allocate(size_t);
+    void allocate(std::size_t);
 };
 
 int main(int, char**)

diff  --git a/libcxx/test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp
index 6c1c89c84a934..5c0b4c2b36d25 100644
--- a/libcxx/test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp
@@ -27,7 +27,7 @@ struct some_alloc
 {
     typedef T value_type;
     some_alloc(const some_alloc&);
-    void allocate(size_t);
+    void allocate(std::size_t);
 };
 
 int main(int, char**)

diff  --git a/libcxx/test/std/containers/sequences/list/list.erasure/erase.pass.cpp b/libcxx/test/std/containers/sequences/list/list.erasure/erase.pass.cpp
index 6b08308cf6d86..977cf24d1e11a 100644
--- a/libcxx/test/std/containers/sequences/list/list.erasure/erase.pass.cpp
+++ b/libcxx/test/std/containers/sequences/list/list.erasure/erase.pass.cpp
@@ -21,7 +21,7 @@
 #include "min_allocator.h"
 
 template <class S, class U>
-void test0(S s, U val, S expected, size_t expected_erased_count) {
+void test0(S s, U val, S expected, std::size_t expected_erased_count) {
   ASSERT_SAME_TYPE(typename S::size_type, decltype(std::erase(s, val)));
   assert(expected_erased_count == std::erase(s, val));
   assert(s == expected);

diff  --git a/libcxx/test/std/containers/sequences/list/list.erasure/erase_if.pass.cpp b/libcxx/test/std/containers/sequences/list/list.erasure/erase_if.pass.cpp
index b6670cbaee35e..db8fd8b21189b 100644
--- a/libcxx/test/std/containers/sequences/list/list.erasure/erase_if.pass.cpp
+++ b/libcxx/test/std/containers/sequences/list/list.erasure/erase_if.pass.cpp
@@ -20,7 +20,7 @@
 #include "min_allocator.h"
 
 template <class S, class Pred>
-void test0(S s, Pred p, S expected, size_t expected_erased_count) {
+void test0(S s, Pred p, S expected, std::size_t expected_erased_count) {
   ASSERT_SAME_TYPE(typename S::size_type, decltype(std::erase_if(s, p)));
   assert(expected_erased_count == std::erase_if(s, p));
   assert(s == expected);

diff  --git a/libcxx/test/std/containers/sequences/list/list.ops/remove_if.pass.cpp b/libcxx/test/std/containers/sequences/list/list.ops/remove_if.pass.cpp
index b8503ef5eca45..c57d81ba718da 100644
--- a/libcxx/test/std/containers/sequences/list/list.ops/remove_if.pass.cpp
+++ b/libcxx/test/std/containers/sequences/list/list.ops/remove_if.pass.cpp
@@ -77,7 +77,7 @@ int main(int, char**)
     std::list<PredLWG526> c(a1, a1 + 7);
     c.remove_if(std::ref(c.front()));
     assert(c.size() == 5);
-    for (size_t i = 0; i < c.size(); ++i)
+    for (std::size_t i = 0; i < c.size(); ++i)
     {
         assert(c.front() == a2[i]);
         c.pop_front();

diff  --git a/libcxx/test/std/containers/sequences/list/list.ops/unique_pred.pass.cpp b/libcxx/test/std/containers/sequences/list/list.ops/unique_pred.pass.cpp
index a33cad8e1a221..e10725438ba0f 100644
--- a/libcxx/test/std/containers/sequences/list/list.ops/unique_pred.pass.cpp
+++ b/libcxx/test/std/containers/sequences/list/list.ops/unique_pred.pass.cpp
@@ -59,7 +59,7 @@ int main(int, char**)
     c.unique(std::ref(c.front()));
 #endif
     assert(c.size() == 6);
-    for (size_t i = 0; i < c.size(); ++i)
+    for (std::size_t i = 0; i < c.size(); ++i)
     {
         assert(c.front() == a2[i]);
         c.pop_front();

diff  --git a/libcxx/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp
index 228d3ef15cb99..ae76236c5d5cc 100644
--- a/libcxx/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp
@@ -34,7 +34,7 @@ struct some_alloc
 
     some_alloc() {}
     some_alloc(const some_alloc&);
-    void allocate(size_t);
+    void allocate(std::size_t);
     void deallocate(void*, unsigned) {}
 
     typedef std::true_type propagate_on_container_swap;
@@ -47,7 +47,7 @@ struct some_alloc2
 
     some_alloc2() {}
     some_alloc2(const some_alloc2&);
-    void allocate(size_t);
+    void allocate(std::size_t);
     void deallocate(void*, unsigned) {}
 
     typedef std::false_type propagate_on_container_swap;

diff  --git a/libcxx/test/std/containers/sequences/vector.bool/insert_iter_iter_iter.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/insert_iter_iter_iter.pass.cpp
index d4756cd0fee63..d3e1297aeec92 100644
--- a/libcxx/test/std/containers/sequences/vector.bool/insert_iter_iter_iter.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector.bool/insert_iter_iter_iter.pass.cpp
@@ -57,7 +57,7 @@ TEST_CONSTEXPR_CXX20 bool tests()
     {
         std::vector<bool> v(100);
         while(v.size() < v.capacity()) v.push_back(false);
-        size_t sz = v.size();
+        std::size_t sz = v.size();
         bool a[] = {1, 0, 0, 1, 1};
         const unsigned N = sizeof(a)/sizeof(a[0]);
         std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, forward_iterator<const bool*>(a),
@@ -76,7 +76,7 @@ TEST_CONSTEXPR_CXX20 bool tests()
         std::vector<bool> v(100);
         while(v.size() < v.capacity()) v.push_back(false);
         v.pop_back(); v.pop_back(); v.pop_back();
-        size_t sz = v.size();
+        std::size_t sz = v.size();
         bool a[] = {1, 0, 0, 1, 1};
         const unsigned N = sizeof(a)/sizeof(a[0]);
         std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, forward_iterator<const bool*>(a),

diff  --git a/libcxx/test/std/containers/sequences/vector.bool/insert_iter_size_value.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/insert_iter_size_value.pass.cpp
index feea1888b70a3..484c57eadb653 100644
--- a/libcxx/test/std/containers/sequences/vector.bool/insert_iter_size_value.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector.bool/insert_iter_size_value.pass.cpp
@@ -36,7 +36,7 @@ TEST_CONSTEXPR_CXX20 bool tests()
     {
         std::vector<bool> v(100);
         while(v.size() < v.capacity()) v.push_back(false);
-        size_t sz = v.size();
+        std::size_t sz = v.size();
         std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, 5, 1);
         assert(v.size() == sz + 5);
         assert(i == v.begin() + 10);
@@ -52,7 +52,7 @@ TEST_CONSTEXPR_CXX20 bool tests()
         std::vector<bool> v(100);
         while(v.size() < v.capacity()) v.push_back(false);
         v.pop_back(); v.pop_back();
-        size_t sz = v.size();
+        std::size_t sz = v.size();
         std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, 5, 1);
         assert(v.size() == sz + 5);
         assert(i == v.begin() + 10);

diff  --git a/libcxx/test/std/containers/sequences/vector.bool/insert_iter_value.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/insert_iter_value.pass.cpp
index b9a926eef5ec7..bb59de3b185a9 100644
--- a/libcxx/test/std/containers/sequences/vector.bool/insert_iter_value.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector.bool/insert_iter_value.pass.cpp
@@ -35,7 +35,7 @@ TEST_CONSTEXPR_CXX20 bool tests()
     {
         std::vector<bool> v(100);
         while(v.size() < v.capacity()) v.push_back(false);
-        size_t sz = v.size();
+        std::size_t sz = v.size();
         std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, 1);
         assert(v.size() == sz + 1);
         assert(i == v.begin() + 10);
@@ -50,7 +50,7 @@ TEST_CONSTEXPR_CXX20 bool tests()
         std::vector<bool> v(100);
         while(v.size() < v.capacity()) v.push_back(false);
         v.pop_back(); v.pop_back();
-        size_t sz = v.size();
+        std::size_t sz = v.size();
         std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, 1);
         assert(v.size() == sz + 1);
         assert(i == v.begin() + 10);

diff  --git a/libcxx/test/std/containers/sequences/vector/contiguous.pass.cpp b/libcxx/test/std/containers/sequences/vector/contiguous.pass.cpp
index ad18e65bb8eac..3c992ba9bb594 100644
--- a/libcxx/test/std/containers/sequences/vector/contiguous.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/contiguous.pass.cpp
@@ -20,7 +20,7 @@
 template <class C>
 TEST_CONSTEXPR_CXX20 void test_contiguous(const C &c)
 {
-    for ( size_t i = 0; i < c.size(); ++i )
+    for ( std::size_t i = 0; i < c.size(); ++i )
         assert ( *(c.begin() + static_cast<typename C::
diff erence_type>(i)) == *(std::addressof(*c.begin()) + i));
 }
 

diff  --git a/libcxx/test/std/containers/sequences/vector/vector.capacity/max_size.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.capacity/max_size.pass.cpp
index 3f8d62e2f2d6b..33abaa04b1207 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.capacity/max_size.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.capacity/max_size.pass.cpp
@@ -28,7 +28,7 @@ TEST_CONSTEXPR_CXX20 bool test() {
     LIBCPP_ASSERT(c.max_size() == 10);
   }
   {
-    typedef limited_allocator<int, (size_t)-1> A;
+    typedef limited_allocator<int, (std::size_t)-1> A;
     typedef std::vector<int, A> C;
     const C::size_type max_dist =
         static_cast<C::size_type>(std::numeric_limits<C::
diff erence_type>::max());

diff  --git a/libcxx/test/std/containers/sequences/vector/vector.capacity/reserve.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.capacity/reserve.pass.cpp
index 387657cc3d2c1..b8548ad72d437 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.capacity/reserve.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.capacity/reserve.pass.cpp
@@ -51,7 +51,7 @@ TEST_CONSTEXPR_CXX20 bool tests() {
 #ifndef TEST_HAS_NO_EXCEPTIONS
     if (!TEST_IS_CONSTANT_EVALUATED) {
         std::vector<int> v;
-        size_t sz = v.max_size() + 1;
+        std::size_t sz = v.max_size() + 1;
 
         try {
             v.reserve(sz);
@@ -64,8 +64,8 @@ TEST_CONSTEXPR_CXX20 bool tests() {
     if (!TEST_IS_CONSTANT_EVALUATED) {
         std::vector<int> v(10, 42);
         int* previous_data = v.data();
-        size_t previous_capacity = v.capacity();
-        size_t sz = v.max_size() + 1;
+        std::size_t previous_capacity = v.capacity();
+        std::size_t sz = v.max_size() + 1;
 
         try {
             v.reserve(sz);

diff  --git a/libcxx/test/std/containers/sequences/vector/vector.cons/assign_iter_iter.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/assign_iter_iter.pass.cpp
index 4daa320673ba2..9b52885b9bf8d 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.cons/assign_iter_iter.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.cons/assign_iter_iter.pass.cpp
@@ -71,7 +71,7 @@ TEST_CONSTEXPR_CXX20 bool test() {
 
     std::vector<int> dst(10);
 
-    size_t n = dst.capacity() * 2;
+    std::size_t n = dst.capacity() * 2;
     std::vector<int> src(n);
 
     dst.assign(It(src.data()), It(src.data() + src.size()));

diff  --git a/libcxx/test/std/containers/sequences/vector/vector.cons/default_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/default_noexcept.pass.cpp
index 3bd4a169d5f92..054ea6430f82a 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.cons/default_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.cons/default_noexcept.pass.cpp
@@ -27,7 +27,7 @@ struct some_alloc
 {
     typedef T value_type;
     some_alloc(const some_alloc&);
-    void allocate(size_t);
+    void allocate(std::size_t);
 };
 
 TEST_CONSTEXPR_CXX20 bool tests() {

diff  --git a/libcxx/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp
index 793475955506d..1b98b7598b97b 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp
@@ -25,7 +25,7 @@ struct some_alloc
     typedef T value_type;
     some_alloc(const some_alloc&);
     ~some_alloc() noexcept(false);
-    void allocate(size_t);
+    void allocate(std::size_t);
 };
 
 TEST_CONSTEXPR_CXX20 bool tests()

diff  --git a/libcxx/test/std/containers/sequences/vector/vector.cons/move_assign_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/move_assign_noexcept.pass.cpp
index fdd74a3f566b7..f466809bf2dd0 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.cons/move_assign_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.cons/move_assign_noexcept.pass.cpp
@@ -29,7 +29,7 @@ struct some_alloc
 {
     typedef T value_type;
     some_alloc(const some_alloc&);
-    void allocate(size_t);
+    void allocate(std::size_t);
 };
 
 template <class T>
@@ -39,7 +39,7 @@ struct some_alloc2
 
     some_alloc2() {}
     some_alloc2(const some_alloc2&);
-    void allocate(size_t);
+    void allocate(std::size_t);
     void deallocate(void*, unsigned) {}
 
     typedef std::false_type propagate_on_container_move_assignment;
@@ -53,7 +53,7 @@ struct some_alloc3
 
     some_alloc3() {}
     some_alloc3(const some_alloc3&);
-    void allocate(size_t);
+    void allocate(std::size_t);
     void deallocate(void*, unsigned) {}
 
     typedef std::false_type propagate_on_container_move_assignment;

diff  --git a/libcxx/test/std/containers/sequences/vector/vector.cons/move_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/move_noexcept.pass.cpp
index 30e9f46dee615..c2bfa5234065d 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.cons/move_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.cons/move_noexcept.pass.cpp
@@ -27,7 +27,7 @@ struct some_alloc
 {
     typedef T value_type;
     some_alloc(const some_alloc&);
-    void allocate(size_t);
+    void allocate(std::size_t);
 };
 
 int main(int, char**)

diff  --git a/libcxx/test/std/containers/sequences/vector/vector.erasure/erase.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.erasure/erase.pass.cpp
index 01a43a9570830..88b27d9634c54 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.erasure/erase.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.erasure/erase.pass.cpp
@@ -21,7 +21,7 @@
 #include "min_allocator.h"
 
 template <class S, class U>
-TEST_CONSTEXPR_CXX20 void test0(S s, U val, S expected, size_t expected_erased_count) {
+TEST_CONSTEXPR_CXX20 void test0(S s, U val, S expected, std::size_t expected_erased_count) {
   ASSERT_SAME_TYPE(typename S::size_type, decltype(std::erase(s, val)));
   assert(expected_erased_count == std::erase(s, val));
   assert(s == expected);

diff  --git a/libcxx/test/std/containers/sequences/vector/vector.erasure/erase_if.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.erasure/erase_if.pass.cpp
index 3da8eca862a28..015824a944571 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.erasure/erase_if.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.erasure/erase_if.pass.cpp
@@ -20,7 +20,7 @@
 #include "min_allocator.h"
 
 template <class S, class Pred>
-TEST_CONSTEXPR_CXX20 void test0(S s, Pred p, S expected, size_t expected_erased_count) {
+TEST_CONSTEXPR_CXX20 void test0(S s, Pred p, S expected, std::size_t expected_erased_count) {
   ASSERT_SAME_TYPE(typename S::size_type, decltype(std::erase_if(s, p)));
   assert(expected_erased_count == std::erase_if(s, p));
   assert(s == expected);

diff  --git a/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp
index 8c0caa74a9322..f186a0d97ae39 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp
@@ -77,7 +77,7 @@ TEST_CONSTEXPR_CXX20 bool tests() {
     {
         std::vector<int> v;
         v.reserve(8);
-        size_t old_capacity = v.capacity();
+        std::size_t old_capacity = v.capacity();
         assert(old_capacity >= 8);
 
         v.resize(4); // keep the existing capacity

diff  --git a/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp
index fe18d2da3b9e5..934b85ce01c67 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp
@@ -68,7 +68,7 @@ TEST_CONSTEXPR_CXX20 bool tests()
         typedef std::vector<int> V;
         V v(100);
         while(v.size() < v.capacity()) v.push_back(0); // force reallocation
-        size_t sz = v.size();
+        std::size_t sz = v.size();
         int a[] = {1, 2, 3, 4, 5};
         const unsigned N = sizeof(a)/sizeof(a[0]);
         V::iterator i = v.insert(v.cbegin() + 10, forward_iterator<const int*>(a),
@@ -87,7 +87,7 @@ TEST_CONSTEXPR_CXX20 bool tests()
         typedef std::vector<int> V;
         V v(100);
         v.reserve(128); // force no reallocation
-        size_t sz = v.size();
+        std::size_t sz = v.size();
         int a[] = {1, 2, 3, 4, 5};
         const unsigned N = sizeof(a)/sizeof(a[0]);
         V::iterator i = v.insert(v.cbegin() + 10, forward_iterator<const int*>(a),

diff  --git a/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_lvalue.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_lvalue.pass.cpp
index 8985435e11c9b..b5582df5bd2c4 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_lvalue.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_lvalue.pass.cpp
@@ -36,7 +36,7 @@ TEST_CONSTEXPR_CXX20 bool test() {
             assert(v[j] == 0);
     }
     {
-        const size_t n = 100;
+        const std::size_t n = 100;
         std::vector<int> v(n);
         v.reserve(n + 1);
         const int lvalue = 1;
@@ -47,7 +47,7 @@ TEST_CONSTEXPR_CXX20 bool test() {
         assert(v.size() == n + 1);
         assert(is_contiguous_container_asan_correct(v));
         assert(it == v.begin() + n);
-        for (size_t i = 0; i < n; ++i) {
+        for (std::size_t i = 0; i < n; ++i) {
             assert(v[i] == 0);
         }
         assert(v[n] == lvalue);
@@ -55,7 +55,7 @@ TEST_CONSTEXPR_CXX20 bool test() {
     {
         std::vector<int> v(100);
         while(v.size() < v.capacity()) v.push_back(0); // force reallocation
-        size_t sz = v.size();
+        std::size_t sz = v.size();
         const int lvalue = 1;
         std::vector<int>::iterator i = v.insert(v.cbegin() + 10, lvalue);
         assert(v.size() == sz + 1);
@@ -72,7 +72,7 @@ TEST_CONSTEXPR_CXX20 bool test() {
         std::vector<int> v(100);
         while(v.size() < v.capacity()) v.push_back(0);
         v.pop_back(); v.pop_back(); // force no reallocation
-        size_t sz = v.size();
+        std::size_t sz = v.size();
         const int lvalue = 1;
         std::vector<int>::iterator i = v.insert(v.cbegin() + 10, lvalue);
         assert(v.size() == sz + 1);

diff  --git a/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp
index f6e447b2ff294..8325fcfd0670f 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp
@@ -38,7 +38,7 @@ TEST_CONSTEXPR_CXX20 bool tests()
     {
         std::vector<int> v(100);
         while(v.size() < v.capacity()) v.push_back(0); // force reallocation
-        size_t sz = v.size();
+        std::size_t sz = v.size();
         std::vector<int>::iterator i = v.insert(v.cbegin() + 10, 5, 1);
         assert(v.size() == sz + 5);
         assert(is_contiguous_container_asan_correct(v));
@@ -54,7 +54,7 @@ TEST_CONSTEXPR_CXX20 bool tests()
     {
         std::vector<int> v(100);
         v.reserve(128); // force no reallocation
-        size_t sz = v.size();
+        std::size_t sz = v.size();
         std::vector<int>::iterator i = v.insert(v.cbegin() + 10, 5, 1);
         assert(v.size() == sz + 5);
         assert(is_contiguous_container_asan_correct(v));

diff  --git a/libcxx/test/std/containers/sequences/vector/vector.special/swap_noexcept.compile.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.special/swap_noexcept.compile.pass.cpp
index 830d05c7012db..d38a00c789f8e 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.special/swap_noexcept.compile.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.special/swap_noexcept.compile.pass.cpp
@@ -35,7 +35,7 @@ struct some_alloc
 
     some_alloc() {}
     some_alloc(const some_alloc&);
-    void allocate(size_t);
+    void allocate(std::size_t);
     void deallocate(void*, unsigned) {}
 
     typedef std::true_type propagate_on_container_swap;
@@ -48,7 +48,7 @@ struct some_alloc2
 
     some_alloc2() {}
     some_alloc2(const some_alloc2&);
-    void allocate(size_t);
+    void allocate(std::size_t);
     void deallocate(void*, unsigned) {}
 
     typedef std::false_type propagate_on_container_swap;

diff  --git a/libcxx/test/std/containers/unord/unord.map/bucket.pass.cpp b/libcxx/test/std/containers/unord/unord.map/bucket.pass.cpp
index 0f2e7216b61eb..14e5b2fe0ad36 100644
--- a/libcxx/test/std/containers/unord/unord.map/bucket.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/bucket.pass.cpp
@@ -37,9 +37,9 @@ int main(int, char**)
             P(2, "four"),
         };
         const C c(std::begin(a), std::end(a));
-        size_t bc = c.bucket_count();
+        std::size_t bc = c.bucket_count();
         assert(bc >= 5);
-        for (size_t i = 0; i < 13; ++i)
+        for (std::size_t i = 0; i < 13; ++i)
             LIBCPP_ASSERT(c.bucket(i) == i % bc);
     }
 #if TEST_STD_VER >= 11
@@ -57,9 +57,9 @@ int main(int, char**)
             P(2, "four"),
         };
         const C c(std::begin(a), std::end(a));
-        size_t bc = c.bucket_count();
+        std::size_t bc = c.bucket_count();
         assert(bc >= 5);
-        for (size_t i = 0; i < 13; ++i)
+        for (std::size_t i = 0; i < 13; ++i)
             LIBCPP_ASSERT(c.bucket(i) == i % bc);
     }
 #endif

diff  --git a/libcxx/test/std/containers/unord/unord.map/compare.pass.cpp b/libcxx/test/std/containers/unord/unord.map/compare.pass.cpp
index 12364fa2dd3fe..200107cddf12a 100644
--- a/libcxx/test/std/containers/unord/unord.map/compare.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/compare.pass.cpp
@@ -30,7 +30,7 @@ namespace std
     template <>
     struct hash<Key>
     {
-        size_t operator()(Key const &) const {return 0;}
+        std::size_t operator()(Key const &) const {return 0;}
     };
 }
 

diff  --git a/libcxx/test/std/containers/unord/unord.map/erase_if.pass.cpp b/libcxx/test/std/containers/unord/unord.map/erase_if.pass.cpp
index 54a8b9b3d3067..329ead0811944 100644
--- a/libcxx/test/std/containers/unord/unord.map/erase_if.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/erase_if.pass.cpp
@@ -31,7 +31,7 @@ M make (Init vals)
 }
 
 template <typename M, typename Pred>
-void test0(Init vals, Pred p, Init expected, size_t expected_erased_count) {
+void test0(Init vals, Pred p, Init expected, std::size_t expected_erased_count) {
   M s = make<M>(vals);
   ASSERT_SAME_TYPE(typename M::size_type, decltype(std::erase_if(s, p)));
   assert(expected_erased_count == std::erase_if(s, p));

diff  --git a/libcxx/test/std/containers/unord/unord.map/max_size.pass.cpp b/libcxx/test/std/containers/unord/unord.map/max_size.pass.cpp
index 7c2ec58de57f4..33c009b67dffd 100644
--- a/libcxx/test/std/containers/unord/unord.map/max_size.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/max_size.pass.cpp
@@ -32,7 +32,7 @@ int main(int, char**)
     LIBCPP_ASSERT(c.max_size() == 10);
   }
   {
-    typedef limited_allocator<KV, (size_t)-1> A;
+    typedef limited_allocator<KV, (std::size_t)-1> A;
     typedef std::unordered_map<int, int, std::hash<int>, std::equal_to<int>, A>
         C;
     const C::size_type max_dist =

diff  --git a/libcxx/test/std/containers/unord/unord.map/rehash.pass.cpp b/libcxx/test/std/containers/unord/unord.map/rehash.pass.cpp
index c8f079fb61780..737e40d6c41cc 100644
--- a/libcxx/test/std/containers/unord/unord.map/rehash.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/rehash.pass.cpp
@@ -22,7 +22,7 @@
 #include "min_allocator.h"
 
 template <class C>
-void rehash_postcondition(const C& c, size_t n)
+void rehash_postcondition(const C& c, std::size_t n)
 {
     assert(c.bucket_count() >= c.size() / c.max_load_factor() && c.bucket_count() >= n);
 }

diff  --git a/libcxx/test/std/containers/unord/unord.map/reserve.pass.cpp b/libcxx/test/std/containers/unord/unord.map/reserve.pass.cpp
index 622a9691e4575..358da35526306 100644
--- a/libcxx/test/std/containers/unord/unord.map/reserve.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/reserve.pass.cpp
@@ -31,14 +31,14 @@ void test(const C& c)
     assert(c.at(4) == "four");
 }
 
-void reserve_invariant(size_t n) // LWG #2156
+void reserve_invariant(std::size_t n) // LWG #2156
 {
-    for (size_t i = 0; i < n; ++i)
+    for (std::size_t i = 0; i < n; ++i)
     {
-        std::unordered_map<size_t, size_t> c;
+        std::unordered_map<std::size_t, size_t> c;
         c.reserve(n);
-        size_t buckets = c.bucket_count();
-        for (size_t j = 0; j < i; ++j)
+        std::size_t buckets = c.bucket_count();
+        for (std::size_t j = 0; j < i; ++j)
         {
             c[i] = i;
             assert(buckets == c.bucket_count());

diff  --git a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/erase_const_iter.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/erase_const_iter.pass.cpp
index 1d0b18bf1d47e..42cc9d1408378 100644
--- a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/erase_const_iter.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/erase_const_iter.pass.cpp
@@ -28,7 +28,7 @@ struct TemplateConstructor
 };
 
 bool operator==(const TemplateConstructor&, const TemplateConstructor&) { return false; }
-struct Hash { size_t operator() (const TemplateConstructor &) const { return 0; } };
+struct Hash { std::size_t operator() (const TemplateConstructor &) const { return 0; } };
 
 int main(int, char**)
 {

diff  --git a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/extract_iterator.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/extract_iterator.pass.cpp
index 2ce98884c3317..ac241c07d972d 100644
--- a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/extract_iterator.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/extract_iterator.pass.cpp
@@ -22,7 +22,7 @@
 template <class Container>
 void test(Container& c)
 {
-    size_t sz = c.size();
+    std::size_t sz = c.size();
 
     auto some_key = c.cbegin()->first;
 

diff  --git a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/extract_key.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/extract_key.pass.cpp
index e1c893f3daf51..78721db16e0be 100644
--- a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/extract_key.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/extract_key.pass.cpp
@@ -24,8 +24,8 @@
 template <class Container, class KeyTypeIter>
 void test(Container& c, KeyTypeIter first, KeyTypeIter last)
 {
-    size_t sz = c.size();
-    assert((size_t)std::distance(first, last) == sz);
+    std::size_t sz = c.size();
+    assert((std::size_t)std::distance(first, last) == sz);
 
     for (KeyTypeIter copy = first; copy != last; ++copy)
     {

diff  --git a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_node_type_hint.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_node_type_hint.pass.cpp
index 821eec9192fd3..8677810187fb0 100644
--- a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_node_type_hint.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_node_type_hint.pass.cpp
@@ -38,7 +38,7 @@ void test(Container& c)
     {
         typename Container::node_type node = nf(i, i + 1);
         assert(!node.empty());
-        size_t prev = c.size();
+        std::size_t prev = c.size();
         auto it = c.insert(c.end(), std::move(node));
         assert(node.empty());
         assert(prev + 1 == c.size());

diff  --git a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_or_assign.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_or_assign.pass.cpp
index 1b7c9e00da470..df2138395adf2 100644
--- a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_or_assign.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_or_assign.pass.cpp
@@ -52,7 +52,7 @@ class Moveable
         {return int_ == x.int_ && double_ == x.double_;}
     bool operator<(const Moveable& x) const
         {return int_ < x.int_ || (int_ == x.int_ && double_ < x.double_);}
-    size_t hash () const { return std::hash<int>()(int_) + std::hash<double>()(double_); }
+    std::size_t hash () const { return std::hash<int>()(int_) + std::hash<double>()(double_); }
 
     int get() const {return int_;}
     bool moved() const {return int_ == -1;}
@@ -60,7 +60,7 @@ class Moveable
 
 namespace std {
     template <> struct hash<Moveable> {
-        size_t operator () (const Moveable &m) const { return m.hash(); }
+        std::size_t operator () (const Moveable &m) const { return m.hash(); }
     };
 }
 

diff  --git a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/merge.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/merge.pass.cpp
index 9953dc8e675c7..e5c29b13dcf12 100644
--- a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/merge.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/merge.pass.cpp
@@ -40,7 +40,7 @@ struct throw_hasher
 
     throw_hasher(bool& should_throw) : should_throw_(should_throw) {}
 
-    size_t operator()(const T& p) const
+    std::size_t operator()(const T& p) const
     {
         if (should_throw_)
             throw 0;
@@ -95,7 +95,7 @@ int main(int, char**)
     struct hasher
     {
         hasher() = default;
-        size_t operator()(const Counter<int>& p) const
+        std::size_t operator()(const Counter<int>& p) const
         {
             return std::hash<Counter<int>>()(p);
         }

diff  --git a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/try.emplace.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/try.emplace.pass.cpp
index bf2c317f712eb..b9c82390ab3a5 100644
--- a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/try.emplace.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/try.emplace.pass.cpp
@@ -51,7 +51,7 @@ class Moveable
         {return int_ == x.int_ && double_ == x.double_;}
     bool operator<(const Moveable& x) const
         {return int_ < x.int_ || (int_ == x.int_ && double_ < x.double_);}
-    size_t hash () const { return std::hash<int>()(int_) + std::hash<double>()(double_); }
+    std::size_t hash () const { return std::hash<int>()(int_) + std::hash<double>()(double_); }
 
     int get() const {return int_;}
     bool moved() const {return int_ == -1;}
@@ -59,7 +59,7 @@ class Moveable
 
 namespace std {
     template <> struct hash<Moveable> {
-        size_t operator () (const Moveable &m) const { return m.hash(); }
+        std::size_t operator () (const Moveable &m) const { return m.hash(); }
     };
 }
 

diff  --git a/libcxx/test/std/containers/unord/unord.multimap/bucket.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/bucket.pass.cpp
index 80c97ddc99cee..034408740315a 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/bucket.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/bucket.pass.cpp
@@ -37,9 +37,9 @@ int main(int, char**)
             P(2, "four"),
         };
         const C c(std::begin(a), std::end(a));
-        size_t bc = c.bucket_count();
+        std::size_t bc = c.bucket_count();
         assert(bc >= 7);
-        for (size_t i = 0; i < 13; ++i)
+        for (std::size_t i = 0; i < 13; ++i)
             LIBCPP_ASSERT(c.bucket(i) == i % bc);
     }
 #if TEST_STD_VER >= 11
@@ -57,9 +57,9 @@ int main(int, char**)
             P(2, "four"),
         };
         const C c(std::begin(a), std::end(a));
-        size_t bc = c.bucket_count();
+        std::size_t bc = c.bucket_count();
         assert(bc >= 7);
-        for (size_t i = 0; i < 13; ++i)
+        for (std::size_t i = 0; i < 13; ++i)
             LIBCPP_ASSERT(c.bucket(i) == i % bc);
     }
 #endif

diff  --git a/libcxx/test/std/containers/unord/unord.multimap/erase_if.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/erase_if.pass.cpp
index 2da3b175a7ae1..90a6cae088c4f 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/erase_if.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/erase_if.pass.cpp
@@ -31,7 +31,7 @@ M make (Init vals)
 }
 
 template <typename M, typename Pred>
-void test0(Init vals, Pred p, Init expected, size_t expected_erased_count) {
+void test0(Init vals, Pred p, Init expected, std::size_t expected_erased_count) {
   M s = make<M>(vals);
   ASSERT_SAME_TYPE(typename M::size_type, decltype(std::erase_if(s, p)));
   assert(expected_erased_count == std::erase_if(s, p));

diff  --git a/libcxx/test/std/containers/unord/unord.multimap/max_size.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/max_size.pass.cpp
index d03cf67ae7c69..182f5a3693b03 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/max_size.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/max_size.pass.cpp
@@ -33,7 +33,7 @@ int main(int, char**)
     LIBCPP_ASSERT(c.max_size() == 10);
   }
   {
-    typedef limited_allocator<KV, (size_t)-1> A;
+    typedef limited_allocator<KV, (std::size_t)-1> A;
     typedef std::unordered_multimap<int, int, std::hash<int>,
                                     std::equal_to<int>, A>
         C;

diff  --git a/libcxx/test/std/containers/unord/unord.multimap/rehash.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/rehash.pass.cpp
index 99538e32d8276..33d2bc0ed107b 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/rehash.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/rehash.pass.cpp
@@ -26,7 +26,7 @@
 #include "min_allocator.h"
 
 template <class C>
-void rehash_postcondition(const C& c, size_t n)
+void rehash_postcondition(const C& c, std::size_t n)
 {
     assert(c.bucket_count() >= c.size() / c.max_load_factor() && c.bucket_count() >= n);
 }

diff  --git a/libcxx/test/std/containers/unord/unord.multimap/reserve.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/reserve.pass.cpp
index 2d3d8f2983942..b658539c401e5 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/reserve.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/reserve.pass.cpp
@@ -46,16 +46,16 @@ void test(const C& c)
     assert(c.find(4)->second == "four");
 }
 
-void reserve_invariant(size_t n) // LWG #2156
+void reserve_invariant(std::size_t n) // LWG #2156
 {
-    for (size_t i = 0; i < n; ++i)
+    for (std::size_t i = 0; i < n; ++i)
     {
-        std::unordered_multimap<size_t, size_t> c;
+        std::unordered_multimap<std::size_t, size_t> c;
         c.reserve(n);
-        size_t buckets = c.bucket_count();
-        for (size_t j = 0; j < i; ++j)
+        std::size_t buckets = c.bucket_count();
+        for (std::size_t j = 0; j < i; ++j)
         {
-            c.insert(std::unordered_multimap<size_t, size_t>::value_type(i,i));
+            c.insert(std::unordered_multimap<std::size_t, size_t>::value_type(i,i));
             assert(buckets == c.bucket_count());
         }
     }

diff  --git a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_const_iter.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_const_iter.pass.cpp
index b237e3a26b9fb..24e9249bd78b2 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_const_iter.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_const_iter.pass.cpp
@@ -31,7 +31,7 @@ struct TemplateConstructor
 };
 
 bool operator==(const TemplateConstructor&, const TemplateConstructor&) { return false; }
-struct Hash { size_t operator() (const TemplateConstructor &) const { return 0; } };
+struct Hash { std::size_t operator() (const TemplateConstructor &) const { return 0; } };
 
 int main(int, char**)
 {

diff  --git a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/extract_iterator.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/extract_iterator.pass.cpp
index 1b9e741539e03..8905dc2c119c4 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/extract_iterator.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/extract_iterator.pass.cpp
@@ -22,7 +22,7 @@
 template <class Container>
 void test(Container& c)
 {
-    size_t sz = c.size();
+    std::size_t sz = c.size();
 
     auto some_key = c.cbegin()->first;
 

diff  --git a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/extract_key.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/extract_key.pass.cpp
index 293e0c0a378df..3f2f69f031b7b 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/extract_key.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/extract_key.pass.cpp
@@ -22,8 +22,8 @@
 template <class Container, class KeyTypeIter>
 void test(Container& c, KeyTypeIter first, KeyTypeIter last)
 {
-    size_t sz = c.size();
-    assert((size_t)std::distance(first, last) == sz);
+    std::size_t sz = c.size();
+    assert((std::size_t)std::distance(first, last) == sz);
 
     for (KeyTypeIter copy = first; copy != last; ++copy)
     {

diff  --git a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_node_type_hint.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_node_type_hint.pass.cpp
index 5b8cd8e39baba..461f7a33d35d0 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_node_type_hint.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_node_type_hint.pass.cpp
@@ -37,7 +37,7 @@ void test(Container& c)
     {
         typename Container::node_type node = nf(i, i + 1);
         assert(!node.empty());
-        size_t prev = c.size();
+        std::size_t prev = c.size();
         auto it = c.insert(c.end(), std::move(node));
         assert(node.empty());
         assert(prev + 1 == c.size());

diff  --git a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/merge.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/merge.pass.cpp
index 04b112682e841..e9c0c3fb75a2a 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/merge.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/merge.pass.cpp
@@ -40,7 +40,7 @@ struct throw_hasher
 
     throw_hasher(bool& should_throw) : should_throw_(should_throw) {}
 
-    size_t operator()(const T& p) const
+    std::size_t operator()(const T& p) const
     {
         if (should_throw_)
             throw 0;
@@ -95,7 +95,7 @@ int main(int, char**)
     struct hasher
     {
         hasher() = default;
-        size_t operator()(const Counter<int>& p) const
+        std::size_t operator()(const Counter<int>& p) const
         {
             return std::hash<Counter<int>>()(p);
         }

diff  --git a/libcxx/test/std/containers/unord/unord.multiset/bucket.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/bucket.pass.cpp
index 5436c1e942208..dd487106c4358 100644
--- a/libcxx/test/std/containers/unord/unord.multiset/bucket.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multiset/bucket.pass.cpp
@@ -35,9 +35,9 @@ int main(int, char**)
             P(2)
         };
         const C c(std::begin(a), std::end(a));
-        size_t bc = c.bucket_count();
+        std::size_t bc = c.bucket_count();
         assert(bc >= 7);
-        for (size_t i = 0; i < 13; ++i)
+        for (std::size_t i = 0; i < 13; ++i)
             LIBCPP_ASSERT(c.bucket(i) == i % bc);
     }
 #if TEST_STD_VER >= 11
@@ -55,9 +55,9 @@ int main(int, char**)
             P(2)
         };
         const C c(std::begin(a), std::end(a));
-        size_t bc = c.bucket_count();
+        std::size_t bc = c.bucket_count();
         assert(bc >= 7);
-        for (size_t i = 0; i < 13; ++i)
+        for (std::size_t i = 0; i < 13; ++i)
             LIBCPP_ASSERT(c.bucket(i) == i % bc);
     }
 #endif

diff  --git a/libcxx/test/std/containers/unord/unord.multiset/erase_const_iter.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/erase_const_iter.pass.cpp
index 2dee50143df8f..ffdcde80d14d3 100644
--- a/libcxx/test/std/containers/unord/unord.multiset/erase_const_iter.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multiset/erase_const_iter.pass.cpp
@@ -27,7 +27,7 @@ struct TemplateConstructor
 };
 
 bool operator==(const TemplateConstructor&, const TemplateConstructor&) { return false; }
-struct Hash { size_t operator() (const TemplateConstructor &) const { return 0; } };
+struct Hash { std::size_t operator() (const TemplateConstructor &) const { return 0; } };
 
 int main(int, char**)
 {

diff  --git a/libcxx/test/std/containers/unord/unord.multiset/erase_if.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/erase_if.pass.cpp
index a7fe88deb2fb4..7bdc4f871571f 100644
--- a/libcxx/test/std/containers/unord/unord.multiset/erase_if.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multiset/erase_if.pass.cpp
@@ -32,7 +32,7 @@ M make (Init vals)
 }
 
 template <typename M, typename Pred>
-void test0(Init vals, Pred p, Init expected, size_t expected_erased_count) {
+void test0(Init vals, Pred p, Init expected, std::size_t expected_erased_count) {
   M s = make<M>(vals);
   ASSERT_SAME_TYPE(typename M::size_type, decltype(std::erase_if(s, p)));
   assert(expected_erased_count == std::erase_if(s, p));

diff  --git a/libcxx/test/std/containers/unord/unord.multiset/extract_iterator.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/extract_iterator.pass.cpp
index 153e56d54bd8d..d88e33bddd70d 100644
--- a/libcxx/test/std/containers/unord/unord.multiset/extract_iterator.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multiset/extract_iterator.pass.cpp
@@ -22,7 +22,7 @@
 template <class Container>
 void test(Container& c)
 {
-    size_t sz = c.size();
+    std::size_t sz = c.size();
 
     for (auto first = c.cbegin(); first != c.cend();)
     {

diff  --git a/libcxx/test/std/containers/unord/unord.multiset/extract_key.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/extract_key.pass.cpp
index 3c4de6ee2d04c..ec1ace86b5661 100644
--- a/libcxx/test/std/containers/unord/unord.multiset/extract_key.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multiset/extract_key.pass.cpp
@@ -22,8 +22,8 @@
 template <class Container, class KeyTypeIter>
 void test(Container& c, KeyTypeIter first, KeyTypeIter last)
 {
-    size_t sz = c.size();
-    assert((size_t)std::distance(first, last) == sz);
+    std::size_t sz = c.size();
+    assert((std::size_t)std::distance(first, last) == sz);
 
     for (KeyTypeIter copy = first; copy != last; ++copy)
     {

diff  --git a/libcxx/test/std/containers/unord/unord.multiset/insert_node_type_hint.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/insert_node_type_hint.pass.cpp
index ff1fc987815f9..2706899b19a95 100644
--- a/libcxx/test/std/containers/unord/unord.multiset/insert_node_type_hint.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multiset/insert_node_type_hint.pass.cpp
@@ -36,7 +36,7 @@ void test(Container& c)
     {
         typename Container::node_type node = nf(i);
         assert(!node.empty());
-        size_t prev = c.size();
+        std::size_t prev = c.size();
         auto it = c.insert(c.end(), std::move(node));
         assert(prev + 1 == c.size());
         assert(*it == i);

diff  --git a/libcxx/test/std/containers/unord/unord.multiset/max_size.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/max_size.pass.cpp
index d08cdb6221fd3..47b165f230007 100644
--- a/libcxx/test/std/containers/unord/unord.multiset/max_size.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multiset/max_size.pass.cpp
@@ -32,7 +32,7 @@ int main(int, char**)
       LIBCPP_ASSERT(c.max_size() == 10);
     }
     {
-      typedef limited_allocator<int, (size_t)-1> A;
+      typedef limited_allocator<int, (std::size_t)-1> A;
       typedef std::unordered_multiset<int, std::hash<int>, std::equal_to<int>,
                                       A>
           C;

diff  --git a/libcxx/test/std/containers/unord/unord.multiset/merge.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/merge.pass.cpp
index fc986ec232e82..00435d8df6a06 100644
--- a/libcxx/test/std/containers/unord/unord.multiset/merge.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multiset/merge.pass.cpp
@@ -40,7 +40,7 @@ struct throw_hasher
 
     throw_hasher(bool& should_throw) : should_throw_(should_throw) {}
 
-    size_t operator()(const T& p) const
+    std::size_t operator()(const T& p) const
     {
         if (should_throw_)
             throw 0;
@@ -95,7 +95,7 @@ int main(int, char**)
     struct hasher
     {
         hasher() = default;
-        size_t operator()(const Counter<int>& p) const { return std::hash<Counter<int>>()(p); }
+        std::size_t operator()(const Counter<int>& p) const { return std::hash<Counter<int>>()(p); }
     };
     {
         typedef std::unordered_multiset<Counter<int>, std::hash<Counter<int>>, std::equal_to<Counter<int>>> first_set_type;

diff  --git a/libcxx/test/std/containers/unord/unord.multiset/rehash.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/rehash.pass.cpp
index 8c6699b18e247..1ef3bdcb99d0b 100644
--- a/libcxx/test/std/containers/unord/unord.multiset/rehash.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multiset/rehash.pass.cpp
@@ -21,7 +21,7 @@
 #include "min_allocator.h"
 
 template <class C>
-void rehash_postcondition(const C& c, size_t n)
+void rehash_postcondition(const C& c, std::size_t n)
 {
     assert(c.bucket_count() >= c.size() / c.max_load_factor() && c.bucket_count() >= n);
 }

diff  --git a/libcxx/test/std/containers/unord/unord.multiset/reserve.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/reserve.pass.cpp
index 54eada5a76989..557a9241b4de1 100644
--- a/libcxx/test/std/containers/unord/unord.multiset/reserve.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multiset/reserve.pass.cpp
@@ -30,14 +30,14 @@ void test(const C& c)
     assert(c.count(4) == 1);
 }
 
-void reserve_invariant(size_t n) // LWG #2156
+void reserve_invariant(std::size_t n) // LWG #2156
 {
-    for (size_t i = 0; i < n; ++i)
+    for (std::size_t i = 0; i < n; ++i)
     {
-        std::unordered_multiset<size_t> c;
+        std::unordered_multiset<std::size_t> c;
         c.reserve(n);
-        size_t buckets = c.bucket_count();
-        for (size_t j = 0; j < i; ++j)
+        std::size_t buckets = c.bucket_count();
+        for (std::size_t j = 0; j < i; ++j)
         {
             c.insert(i);
             assert(buckets == c.bucket_count());

diff  --git a/libcxx/test/std/containers/unord/unord.set/bucket.pass.cpp b/libcxx/test/std/containers/unord/unord.set/bucket.pass.cpp
index bcaa77b4aa1fb..969c3f6b93e74 100644
--- a/libcxx/test/std/containers/unord/unord.set/bucket.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.set/bucket.pass.cpp
@@ -35,9 +35,9 @@ int main(int, char**)
             P(2)
         };
         const C c(std::begin(a), std::end(a));
-        size_t bc = c.bucket_count();
+        std::size_t bc = c.bucket_count();
         assert(bc >= 5);
-        for (size_t i = 0; i < 13; ++i)
+        for (std::size_t i = 0; i < 13; ++i)
             LIBCPP_ASSERT(c.bucket(i) == i % bc);
     }
 #if TEST_STD_VER >= 11
@@ -54,9 +54,9 @@ int main(int, char**)
             P(2)
         };
         const C c(std::begin(a), std::end(a));
-        size_t bc = c.bucket_count();
+        std::size_t bc = c.bucket_count();
         assert(bc >= 5);
-        for (size_t i = 0; i < 13; ++i)
+        for (std::size_t i = 0; i < 13; ++i)
             LIBCPP_ASSERT(c.bucket(i) == i % bc);
     }
 #endif

diff  --git a/libcxx/test/std/containers/unord/unord.set/erase_const_iter.pass.cpp b/libcxx/test/std/containers/unord/unord.set/erase_const_iter.pass.cpp
index cc709132d9102..4a66329d57177 100644
--- a/libcxx/test/std/containers/unord/unord.set/erase_const_iter.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.set/erase_const_iter.pass.cpp
@@ -27,7 +27,7 @@ struct TemplateConstructor
 };
 
 bool operator==(const TemplateConstructor&, const TemplateConstructor&) { return false; }
-struct Hash { size_t operator() (const TemplateConstructor &) const { return 0; } };
+struct Hash { std::size_t operator() (const TemplateConstructor &) const { return 0; } };
 
 int main(int, char**)
 {

diff  --git a/libcxx/test/std/containers/unord/unord.set/erase_if.pass.cpp b/libcxx/test/std/containers/unord/unord.set/erase_if.pass.cpp
index a2c7325b1c470..ba5f3bfe181fc 100644
--- a/libcxx/test/std/containers/unord/unord.set/erase_if.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.set/erase_if.pass.cpp
@@ -32,7 +32,7 @@ M make (Init vals)
 }
 
 template <typename M, typename Pred>
-void test0(Init vals, Pred p, Init expected, size_t expected_erased_count) {
+void test0(Init vals, Pred p, Init expected, std::size_t expected_erased_count) {
   M s = make<M>(vals);
   ASSERT_SAME_TYPE(typename M::size_type, decltype(std::erase_if(s, p)));
   assert(expected_erased_count == std::erase_if(s, p));

diff  --git a/libcxx/test/std/containers/unord/unord.set/extract_iterator.pass.cpp b/libcxx/test/std/containers/unord/unord.set/extract_iterator.pass.cpp
index d4a0a7c8ce464..f6382502e6354 100644
--- a/libcxx/test/std/containers/unord/unord.set/extract_iterator.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.set/extract_iterator.pass.cpp
@@ -22,7 +22,7 @@
 template <class Container>
 void test(Container& c)
 {
-    size_t sz = c.size();
+    std::size_t sz = c.size();
 
     for (auto first = c.cbegin(); first != c.cend();)
     {

diff  --git a/libcxx/test/std/containers/unord/unord.set/extract_key.pass.cpp b/libcxx/test/std/containers/unord/unord.set/extract_key.pass.cpp
index e0d48567a7c3e..3bfb6c358c8b6 100644
--- a/libcxx/test/std/containers/unord/unord.set/extract_key.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.set/extract_key.pass.cpp
@@ -22,8 +22,8 @@
 template <class Container, class KeyTypeIter>
 void test(Container& c, KeyTypeIter first, KeyTypeIter last)
 {
-    size_t sz = c.size();
-    assert((size_t)std::distance(first, last) == sz);
+    std::size_t sz = c.size();
+    assert((std::size_t)std::distance(first, last) == sz);
 
     for (KeyTypeIter copy = first; copy != last; ++copy)
     {

diff  --git a/libcxx/test/std/containers/unord/unord.set/insert_node_type_hint.pass.cpp b/libcxx/test/std/containers/unord/unord.set/insert_node_type_hint.pass.cpp
index 3bb7d4fb53370..b4b3d8822592c 100644
--- a/libcxx/test/std/containers/unord/unord.set/insert_node_type_hint.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.set/insert_node_type_hint.pass.cpp
@@ -37,7 +37,7 @@ void test(Container& c)
     {
         typename Container::node_type node = nf(i);
         assert(!node.empty());
-        size_t prev = c.size();
+        std::size_t prev = c.size();
         auto it = c.insert(c.end(), std::move(node));
         assert(node.empty());
         assert(prev + 1 == c.size());

diff  --git a/libcxx/test/std/containers/unord/unord.set/max_size.pass.cpp b/libcxx/test/std/containers/unord/unord.set/max_size.pass.cpp
index aeb1354da5621..289c4d3231749 100644
--- a/libcxx/test/std/containers/unord/unord.set/max_size.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.set/max_size.pass.cpp
@@ -30,7 +30,7 @@ int main(int, char**)
       LIBCPP_ASSERT(c.max_size() == 10);
     }
     {
-      typedef limited_allocator<int, (size_t)-1> A;
+      typedef limited_allocator<int, (std::size_t)-1> A;
       typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, A> C;
       const C::size_type max_dist =
           static_cast<C::size_type>(std::numeric_limits<C::
diff erence_type>::max());

diff  --git a/libcxx/test/std/containers/unord/unord.set/merge.pass.cpp b/libcxx/test/std/containers/unord/unord.set/merge.pass.cpp
index ef06ca8bdbf73..c1b0e174cc0c1 100644
--- a/libcxx/test/std/containers/unord/unord.set/merge.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.set/merge.pass.cpp
@@ -40,7 +40,7 @@ struct throw_hasher
 
     throw_hasher(bool& should_throw) : should_throw_(should_throw) {}
 
-    size_t operator()(const T& p) const
+    std::size_t operator()(const T& p) const
     {
         if (should_throw_)
             throw 0;
@@ -95,7 +95,7 @@ int main(int, char**)
     struct hasher
     {
         hasher() = default;
-        size_t operator()(const Counter<int>& p) const { return std::hash<Counter<int>>()(p); }
+        std::size_t operator()(const Counter<int>& p) const { return std::hash<Counter<int>>()(p); }
     };
     {
         typedef std::unordered_set<Counter<int>, std::hash<Counter<int>>, std::equal_to<Counter<int>>> first_set_type;

diff  --git a/libcxx/test/std/containers/unord/unord.set/rehash.pass.cpp b/libcxx/test/std/containers/unord/unord.set/rehash.pass.cpp
index e45327ad7ec51..a0482fc2db706 100644
--- a/libcxx/test/std/containers/unord/unord.set/rehash.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.set/rehash.pass.cpp
@@ -21,7 +21,7 @@
 #include "min_allocator.h"
 
 template <class C>
-void rehash_postcondition(const C& c, size_t n)
+void rehash_postcondition(const C& c, std::size_t n)
 {
     assert(c.bucket_count() >= c.size() / c.max_load_factor() && c.bucket_count() >= n);
 }

diff  --git a/libcxx/test/std/containers/unord/unord.set/reserve.pass.cpp b/libcxx/test/std/containers/unord/unord.set/reserve.pass.cpp
index 7ea358e889d48..afcccf9e03795 100644
--- a/libcxx/test/std/containers/unord/unord.set/reserve.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.set/reserve.pass.cpp
@@ -30,14 +30,14 @@ void test(const C& c)
     assert(c.count(4) == 1);
 }
 
-void reserve_invariant(size_t n) // LWG #2156
+void reserve_invariant(std::size_t n) // LWG #2156
 {
-    for (size_t i = 0; i < n; ++i)
+    for (std::size_t i = 0; i < n; ++i)
     {
-        std::unordered_set<size_t> c;
+        std::unordered_set<std::size_t> c;
         c.reserve(n);
-        size_t buckets = c.bucket_count();
-        for (size_t j = 0; j < i; ++j)
+        std::size_t buckets = c.bucket_count();
+        for (std::size_t j = 0; j < i; ++j)
         {
             c.insert(i);
             assert(buckets == c.bucket_count());

diff  --git a/libcxx/test/std/containers/views/views.span/span.cons/assign.pass.cpp b/libcxx/test/std/containers/views/views.span/span.cons/assign.pass.cpp
index 7481987862ed5..3f358116b8c6f 100644
--- a/libcxx/test/std/containers/views/views.span/span.cons/assign.pass.cpp
+++ b/libcxx/test/std/containers/views/views.span/span.cons/assign.pass.cpp
@@ -241,8 +241,8 @@ int main(int, char**)
             {arr + 1, arr + 3} // same size as s2
             };
 
-        for (size_t i = 0; i < std::size(spans); ++i)
-            for (size_t j = i; j < std::size(spans); ++j)
+        for (std::size_t i = 0; i < std::size(spans); ++i)
+            for (std::size_t j = i; j < std::size(spans); ++j)
                 assert((doAssign(spans[i], spans[j])));
     }
 
@@ -255,8 +255,8 @@ int main(int, char**)
             spanType{arr + 2, arr + 4}
             };
 
-        for (size_t i = 0; i < std::size(spans); ++i)
-            for (size_t j = i; j < std::size(spans); ++j)
+        for (std::size_t i = 0; i < std::size(spans); ++i)
+            for (std::size_t j = i; j < std::size(spans); ++j)
                 assert((doAssign(spans[i], spans[j])));
     }
 
@@ -275,8 +275,8 @@ int main(int, char**)
             {strs + 3, strs + 3}
             };
 
-        for (size_t i = 0; i < std::size(spans); ++i)
-            for (size_t j = i; j < std::size(spans); ++j)
+        for (std::size_t i = 0; i < std::size(spans); ++i)
+            for (std::size_t j = i; j < std::size(spans); ++j)
                 assert((doAssign(spans[i], spans[j])));
     }
 
@@ -288,8 +288,8 @@ int main(int, char**)
             spanType{strs + 2, strs + 3}
             };
 
-        for (size_t i = 0; i < std::size(spans); ++i)
-            for (size_t j = i; j < std::size(spans); ++j)
+        for (std::size_t i = 0; i < std::size(spans); ++i)
+            for (std::size_t j = i; j < std::size(spans); ++j)
                 assert((doAssign(spans[i], spans[j])));
     }
 

diff  --git a/libcxx/test/std/containers/views/views.span/span.cons/iterator_len.pass.cpp b/libcxx/test/std/containers/views/views.span/span.cons/iterator_len.pass.cpp
index f197330331411..fbbd3d6ff4044 100644
--- a/libcxx/test/std/containers/views/views.span/span.cons/iterator_len.pass.cpp
+++ b/libcxx/test/std/containers/views/views.span/span.cons/iterator_len.pass.cpp
@@ -20,23 +20,23 @@
 #include <iterator>
 #include <type_traits>
 
-template <size_t Extent>
+template <std::size_t Extent>
 constexpr void test_constructibility() {
   struct Other {};
-  static_assert(std::is_constructible_v<std::span<int, Extent>, int*, size_t>);
-  static_assert(!std::is_constructible_v<std::span<int, Extent>, const int*, size_t>);
-  static_assert(std::is_constructible_v<std::span<const int, Extent>, int*, size_t>);
-  static_assert(std::is_constructible_v<std::span<const int, Extent>, const int*, size_t>);
-  static_assert(!std::is_constructible_v<std::span<int, Extent>, volatile int*, size_t>);
-  static_assert(!std::is_constructible_v<std::span<int, Extent>, const volatile int*, size_t>);
-  static_assert(!std::is_constructible_v<std::span<const int, Extent>, volatile int*, size_t>);
-  static_assert(!std::is_constructible_v<std::span<const int, Extent>, const volatile int*, size_t>);
-  static_assert(!std::is_constructible_v<std::span<volatile int, Extent>, const int*, size_t>);
-  static_assert(!std::is_constructible_v<std::span<volatile int, Extent>, const volatile int*, size_t>);
+  static_assert(std::is_constructible_v<std::span<int, Extent>, int*, std::size_t>);
+  static_assert(!std::is_constructible_v<std::span<int, Extent>, const int*, std::size_t>);
+  static_assert(std::is_constructible_v<std::span<const int, Extent>, int*, std::size_t>);
+  static_assert(std::is_constructible_v<std::span<const int, Extent>, const int*, std::size_t>);
+  static_assert(!std::is_constructible_v<std::span<int, Extent>, volatile int*, std::size_t>);
+  static_assert(!std::is_constructible_v<std::span<int, Extent>, const volatile int*, std::size_t>);
+  static_assert(!std::is_constructible_v<std::span<const int, Extent>, volatile int*, std::size_t>);
+  static_assert(!std::is_constructible_v<std::span<const int, Extent>, const volatile int*, std::size_t>);
+  static_assert(!std::is_constructible_v<std::span<volatile int, Extent>, const int*, std::size_t>);
+  static_assert(!std::is_constructible_v<std::span<volatile int, Extent>, const volatile int*, std::size_t>);
   static_assert(
-      !std::is_constructible_v<std::span<int, Extent>, double*, size_t>); // iterator type 
diff ers from span type
-  static_assert(!std::is_constructible_v<std::span<int, Extent>, size_t, size_t>);
-  static_assert(!std::is_constructible_v<std::span<int, Extent>, Other*, size_t>); // unrelated iterator type
+      !std::is_constructible_v<std::span<int, Extent>, double*, std::size_t>); // iterator type 
diff ers from span type
+  static_assert(!std::is_constructible_v<std::span<int, Extent>, std::size_t, size_t>);
+  static_assert(!std::is_constructible_v<std::span<int, Extent>, Other*, std::size_t>); // unrelated iterator type
 }
 
 template <class T>

diff  --git a/libcxx/test/std/containers/views/views.span/span.cons/iterator_len.verify.cpp b/libcxx/test/std/containers/views/views.span/span.cons/iterator_len.verify.cpp
index dc287cbe83114..3836c97e94c6d 100644
--- a/libcxx/test/std/containers/views/views.span/span.cons/iterator_len.verify.cpp
+++ b/libcxx/test/std/containers/views/views.span/span.cons/iterator_len.verify.cpp
@@ -17,8 +17,8 @@
 #include <span>
 #include <cstddef>
 
-template <class T, size_t extent>
-std::span<T, extent> createImplicitSpan(T* ptr, size_t len) {
+template <class T, std::size_t extent>
+std::span<T, extent> createImplicitSpan(T* ptr, std::size_t len) {
   return {ptr, len}; // expected-error {{chosen constructor is explicit in copy-initialization}}
 }
 

diff  --git a/libcxx/test/std/containers/views/views.span/span.cons/iterator_sentinel.pass.cpp b/libcxx/test/std/containers/views/views.span/span.cons/iterator_sentinel.pass.cpp
index 335d2b850f6df..c2d650bfaffa5 100644
--- a/libcxx/test/std/containers/views/views.span/span.cons/iterator_sentinel.pass.cpp
+++ b/libcxx/test/std/containers/views/views.span/span.cons/iterator_sentinel.pass.cpp
@@ -34,7 +34,7 @@ constexpr bool test_ctor() {
   return true;
 }
 
-template <size_t Extent>
+template <std::size_t Extent>
 constexpr void test_constructibility() {
   static_assert(std::is_constructible_v<std::span<int, Extent>, int*, int*>);
   static_assert(!std::is_constructible_v<std::span<int, Extent>, const int*, const int*>);

diff  --git a/libcxx/test/std/containers/views/views.span/span.cons/iterator_sentinel.verify.cpp b/libcxx/test/std/containers/views/views.span/span.cons/iterator_sentinel.verify.cpp
index d0d81df313d37..a31aa2af7b9dd 100644
--- a/libcxx/test/std/containers/views/views.span/span.cons/iterator_sentinel.verify.cpp
+++ b/libcxx/test/std/containers/views/views.span/span.cons/iterator_sentinel.verify.cpp
@@ -18,7 +18,7 @@
 #include <span>
 #include <iterator>
 
-template<class T, size_t Extent>
+template<class T, std::size_t Extent>
 std::span<T, Extent> createImplicitSpan(T* first, T* last) {
     return {first, last}; // expected-error {{chosen constructor is explicit in copy-initialization}}
 }

diff  --git a/libcxx/test/std/containers/views/views.span/span.cons/range.pass.cpp b/libcxx/test/std/containers/views/views.span/span.cons/range.pass.cpp
index d4847549785be..71fee430f8f42 100644
--- a/libcxx/test/std/containers/views/views.span/span.cons/range.pass.cpp
+++ b/libcxx/test/std/containers/views/views.span/span.cons/range.pass.cpp
@@ -22,7 +22,7 @@
 
 #include "test_iterators.h"
 
-template <class T, size_t Extent>
+template <class T, std::size_t Extent>
 constexpr void test_from_range() {
   T val[3]{};
   std::span<T, Extent> s{val};

diff  --git a/libcxx/test/std/containers/views/views.span/span.cons/span.fail.cpp b/libcxx/test/std/containers/views/views.span/span.cons/span.fail.cpp
index c3c3631c5f3d9..784530ebcb106 100644
--- a/libcxx/test/std/containers/views/views.span/span.cons/span.fail.cpp
+++ b/libcxx/test/std/containers/views/views.span/span.cons/span.fail.cpp
@@ -23,7 +23,7 @@
 
 #include "test_macros.h"
 
-template<class T, size_t extent, size_t otherExtent>
+template<class T, std::size_t extent, size_t otherExtent>
 std::span<T, extent> createImplicitSpan(std::span<T, otherExtent> s) {
     return {s}; // expected-error {{chosen constructor is explicit in copy-initialization}}
 }

diff  --git a/libcxx/test/std/containers/views/views.span/span.elem/op_idx.pass.cpp b/libcxx/test/std/containers/views/views.span/span.elem/op_idx.pass.cpp
index fdafbfc73e129..e46fd267ef5cc 100644
--- a/libcxx/test/std/containers/views/views.span/span.elem/op_idx.pass.cpp
+++ b/libcxx/test/std/containers/views/views.span/span.elem/op_idx.pass.cpp
@@ -21,7 +21,7 @@
 
 
 template <typename Span>
-constexpr bool testConstexprSpan(Span sp, size_t idx)
+constexpr bool testConstexprSpan(Span sp, std::size_t idx)
 {
     LIBCPP_ASSERT(noexcept(sp[idx]));
 
@@ -32,7 +32,7 @@ constexpr bool testConstexprSpan(Span sp, size_t idx)
 
 
 template <typename Span>
-void testRuntimeSpan(Span sp, size_t idx)
+void testRuntimeSpan(Span sp, std::size_t idx)
 {
     LIBCPP_ASSERT(noexcept(sp[idx]));
 

diff  --git a/libcxx/test/std/containers/views/views.span/span.iterators/end.pass.cpp b/libcxx/test/std/containers/views/views.span/span.iterators/end.pass.cpp
index d531537bb195d..d6aaf74d1058c 100644
--- a/libcxx/test/std/containers/views/views.span/span.iterators/end.pass.cpp
+++ b/libcxx/test/std/containers/views/views.span/span.iterators/end.pass.cpp
@@ -34,7 +34,7 @@ constexpr bool testConstexprSpan(Span s)
         ret = ret &&  (&*( e-1) == last);
     }
 
-    ret = ret &&  (static_cast<size_t>(e - s.begin()) == s.size());
+    ret = ret &&  (static_cast<std::size_t>(e - s.begin()) == s.size());
     return ret;
 }
 
@@ -53,7 +53,7 @@ void testRuntimeSpan(Span s)
         assert(&*( e-1) == last);
     }
 
-    assert(static_cast<size_t>(e - s.begin()) == s.size());
+    assert(static_cast<std::size_t>(e - s.begin()) == s.size());
 }
 
 

diff  --git a/libcxx/test/std/containers/views/views.span/span.iterators/rend.pass.cpp b/libcxx/test/std/containers/views/views.span/span.iterators/rend.pass.cpp
index c2bd13aaf612b..ffec15c6b2492 100644
--- a/libcxx/test/std/containers/views/views.span/span.iterators/rend.pass.cpp
+++ b/libcxx/test/std/containers/views/views.span/span.iterators/rend.pass.cpp
@@ -32,7 +32,7 @@ constexpr bool testConstexprSpan(Span s)
         ret = ret &&  (e != s.rbegin());
     }
 
-    ret = ret &&  (static_cast<size_t>(e - s.rbegin()) == s.size());
+    ret = ret &&  (static_cast<std::size_t>(e - s.rbegin()) == s.size());
     return ret;
 }
 
@@ -49,7 +49,7 @@ void testRuntimeSpan(Span s)
         assert(e != s.rbegin());
     }
 
-    assert(static_cast<size_t>(e - s.rbegin()) == s.size());
+    assert(static_cast<std::size_t>(e - s.rbegin()) == s.size());
 }
 
 

diff  --git a/libcxx/test/std/containers/views/views.span/span.objectrep/as_writable_bytes.verify.cpp b/libcxx/test/std/containers/views/views.span/span.objectrep/as_writable_bytes.verify.cpp
index d32d5912c7843..45485b339752c 100644
--- a/libcxx/test/std/containers/views/views.span/span.objectrep/as_writable_bytes.verify.cpp
+++ b/libcxx/test/std/containers/views/views.span/span.objectrep/as_writable_bytes.verify.cpp
@@ -36,7 +36,7 @@ void f() {
   std::as_writable_bytes(std::span<const long, 0>());        // expected-error {{no matching function for call to 'as_writable_bytes'}}
   std::as_writable_bytes(std::span<const double, 0>());      // expected-error {{no matching function for call to 'as_writable_bytes'}}
   std::as_writable_bytes(std::span<const A, 0>());           // expected-error {{no matching function for call to 'as_writable_bytes'}}
-  std::as_writable_bytes(std::span<const std::string, (size_t)0>()); // expected-error {{no matching function for call to 'as_writable_bytes'}}
+  std::as_writable_bytes(std::span<const std::string, (std::size_t)0>()); // expected-error {{no matching function for call to 'as_writable_bytes'}}
 
   std::as_writable_bytes(std::span<const int>   (iArr2, 1));     // expected-error {{no matching function for call to 'as_writable_bytes'}}
   std::as_writable_bytes(std::span<const int, 1>(iArr2 + 5, 1)); // expected-error {{no matching function for call to 'as_writable_bytes'}}

diff  --git a/libcxx/test/std/containers/views/views.span/span.obs/size.pass.cpp b/libcxx/test/std/containers/views/views.span/span.obs/size.pass.cpp
index 5be7b9850670d..fa41d7803e97e 100644
--- a/libcxx/test/std/containers/views/views.span/span.obs/size.pass.cpp
+++ b/libcxx/test/std/containers/views/views.span/span.obs/size.pass.cpp
@@ -21,7 +21,7 @@
 
 
 template <typename Span>
-constexpr bool testConstexprSpan(Span sp, size_t sz)
+constexpr bool testConstexprSpan(Span sp, std::size_t sz)
 {
     ASSERT_NOEXCEPT(sp.size());
     return sp.size() == sz;
@@ -29,7 +29,7 @@ constexpr bool testConstexprSpan(Span sp, size_t sz)
 
 
 template <typename Span>
-void testRuntimeSpan(Span sp, size_t sz)
+void testRuntimeSpan(Span sp, std::size_t sz)
 {
     ASSERT_NOEXCEPT(sp.size());
     assert(sp.size() == sz);

diff  --git a/libcxx/test/std/containers/views/views.span/span.obs/size_bytes.pass.cpp b/libcxx/test/std/containers/views/views.span/span.obs/size_bytes.pass.cpp
index 9ce6d2679cc52..c25eaaa2017bf 100644
--- a/libcxx/test/std/containers/views/views.span/span.obs/size_bytes.pass.cpp
+++ b/libcxx/test/std/containers/views/views.span/span.obs/size_bytes.pass.cpp
@@ -22,18 +22,18 @@
 
 
 template <typename Span>
-constexpr bool testConstexprSpan(Span sp, size_t sz)
+constexpr bool testConstexprSpan(Span sp, std::size_t sz)
 {
     ASSERT_NOEXCEPT(sp.size_bytes());
-    return (size_t) sp.size_bytes() == sz * sizeof(typename Span::element_type);
+    return (std::size_t) sp.size_bytes() == sz * sizeof(typename Span::element_type);
 }
 
 
 template <typename Span>
-void testRuntimeSpan(Span sp, size_t sz)
+void testRuntimeSpan(Span sp, std::size_t sz)
 {
     ASSERT_NOEXCEPT(sp.size_bytes());
-    assert((size_t) sp.size_bytes() == sz * sizeof(typename Span::element_type));
+    assert((std::size_t) sp.size_bytes() == sz * sizeof(typename Span::element_type));
 }
 
 struct A{};

diff  --git a/libcxx/test/std/containers/views/views.span/span.sub/first.pass.cpp b/libcxx/test/std/containers/views/views.span/span.sub/first.pass.cpp
index 37baea2c7c34a..a354ade2247ae 100644
--- a/libcxx/test/std/containers/views/views.span/span.sub/first.pass.cpp
+++ b/libcxx/test/std/containers/views/views.span/span.sub/first.pass.cpp
@@ -23,7 +23,7 @@
 
 #include "test_macros.h"
 
-template <typename Span, size_t Count>
+template <typename Span, std::size_t Count>
 constexpr bool testConstexprSpan(Span sp)
 {
     LIBCPP_ASSERT((noexcept(sp.template first<Count>())));
@@ -43,7 +43,7 @@ constexpr bool testConstexprSpan(Span sp)
 }
 
 
-template <typename Span, size_t Count>
+template <typename Span, std::size_t Count>
 void testRuntimeSpan(Span sp)
 {
     LIBCPP_ASSERT((noexcept(sp.template first<Count>())));

diff  --git a/libcxx/test/std/containers/views/views.span/span.sub/last.pass.cpp b/libcxx/test/std/containers/views/views.span/span.sub/last.pass.cpp
index 1cddaa15952cf..017c805af3ed5 100644
--- a/libcxx/test/std/containers/views/views.span/span.sub/last.pass.cpp
+++ b/libcxx/test/std/containers/views/views.span/span.sub/last.pass.cpp
@@ -23,7 +23,7 @@
 
 #include "test_macros.h"
 
-template <typename Span, size_t Count>
+template <typename Span, std::size_t Count>
 constexpr bool testConstexprSpan(Span sp)
 {
     LIBCPP_ASSERT((noexcept(sp.template last<Count>())));
@@ -43,7 +43,7 @@ constexpr bool testConstexprSpan(Span sp)
 }
 
 
-template <typename Span, size_t Count>
+template <typename Span, std::size_t Count>
 void testRuntimeSpan(Span sp)
 {
     LIBCPP_ASSERT((noexcept(sp.template last<Count>())));

diff  --git a/libcxx/test/std/containers/views/views.span/span.sub/subspan.pass.cpp b/libcxx/test/std/containers/views/views.span/span.sub/subspan.pass.cpp
index bc5731396699b..401363090e6e5 100644
--- a/libcxx/test/std/containers/views/views.span/span.sub/subspan.pass.cpp
+++ b/libcxx/test/std/containers/views/views.span/span.sub/subspan.pass.cpp
@@ -24,7 +24,7 @@
 
 #include "test_macros.h"
 
-template <typename Span, size_t Offset, size_t Count>
+template <typename Span, std::size_t Offset, size_t Count>
 constexpr bool testConstexprSpan(Span sp)
 {
     LIBCPP_ASSERT((noexcept(sp.template subspan<Offset, Count>())));
@@ -43,7 +43,7 @@ constexpr bool testConstexprSpan(Span sp)
      && std::equal(s1.begin(), s1.end(), sp.begin() + Offset);
 }
 
-template <typename Span, size_t Offset>
+template <typename Span, std::size_t Offset>
 constexpr bool testConstexprSpan(Span sp)
 {
     LIBCPP_ASSERT((noexcept(sp.template subspan<Offset>())));
@@ -63,7 +63,7 @@ constexpr bool testConstexprSpan(Span sp)
 }
 
 
-template <typename Span, size_t Offset, size_t Count>
+template <typename Span, std::size_t Offset, size_t Count>
 void testRuntimeSpan(Span sp)
 {
     LIBCPP_ASSERT((noexcept(sp.template subspan<Offset, Count>())));
@@ -82,7 +82,7 @@ void testRuntimeSpan(Span sp)
 }
 
 
-template <typename Span, size_t Offset>
+template <typename Span, std::size_t Offset>
 void testRuntimeSpan(Span sp)
 {
     LIBCPP_ASSERT((noexcept(sp.template subspan<Offset>())));

diff  --git a/libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/custom_alloc.pass.cpp b/libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/custom_alloc.pass.cpp
index 025bc0b74c8c9..83e3009ce4f83 100644
--- a/libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/custom_alloc.pass.cpp
+++ b/libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/custom_alloc.pass.cpp
@@ -34,7 +34,7 @@ void my_free(void*)
 struct test
     : std::strstreambuf
 {
-    test(void* (*palloc_arg)(size_t), void (*pfree_arg)(void*))
+    test(void* (*palloc_arg)(std::size_t), void (*pfree_arg)(void*))
         : std::strstreambuf(palloc_arg, pfree_arg) {}
     virtual int_type overflow(int_type c)
         {return std::strstreambuf::overflow(c);}

diff  --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/allocate.pass.cpp b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/allocate.pass.cpp
index 297235efc48c5..1b33f796aac23 100644
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/allocate.pass.cpp
+++ b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/allocate.pass.cpp
@@ -36,7 +36,7 @@
 
 namespace ex = std::experimental::pmr;
 
-template <size_t S, size_t Align>
+template <std::size_t S, size_t Align>
 void testForSizeAndAlign() {
     struct T { alignas(Align) char data[S]; };
     TestResource R;
@@ -52,7 +52,7 @@ void testForSizeAndAlign() {
 }
 
 #ifndef TEST_HAS_NO_EXCEPTIONS
-template <size_t S>
+template <std::size_t S>
 void testAllocForSizeThrows() {
     struct T { char data[S]; };
     using Alloc = ex::polymorphic_allocator<T>;
@@ -61,14 +61,14 @@ void testAllocForSizeThrows() {
     Alloc a(&R);
 
     // Test that allocating exactly the max size does not throw.
-    size_t maxSize = Traits::max_size(a);
+    std::size_t maxSize = Traits::max_size(a);
     try {
         a.allocate(maxSize);
     } catch (...) {
         assert(false);
     }
 
-    size_t sizeTypeMax = std::numeric_limits<std::size_t>::max();
+    std::size_t sizeTypeMax = std::numeric_limits<std::size_t>::max();
     if (maxSize != sizeTypeMax)
     {
         // Test that allocating size_t(~0) throws bad_array_new_length.
@@ -79,7 +79,7 @@ void testAllocForSizeThrows() {
         }
 
         // Test that allocating even one more than the max size does throw.
-        size_t overSize = maxSize + 1;
+        std::size_t overSize = maxSize + 1;
         try {
             a.allocate(overSize);
             assert(false);

diff  --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/deallocate.pass.cpp b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/deallocate.pass.cpp
index 0084d37a50839..4bdccf8a7dc80 100644
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/deallocate.pass.cpp
+++ b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/deallocate.pass.cpp
@@ -34,7 +34,7 @@
 
 namespace ex = std::experimental::pmr;
 
-template <size_t S, size_t Align>
+template <std::size_t S, size_t Align>
 void testForSizeAndAlign() {
     struct T { alignas(Align) char data[S]; };
 

diff  --git a/libcxx/test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp
index 44b00cbb47a2a..d645fc1941f9f 100644
--- a/libcxx/test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp
+++ b/libcxx/test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp
@@ -32,10 +32,10 @@ namespace ex = std::experimental::pmr;
 struct assert_on_compare : public ex::memory_resource
 {
 protected:
-    void * do_allocate(size_t, size_t) override
+    void * do_allocate(std::size_t, size_t) override
     { assert(false); return nullptr; }
 
-    void do_deallocate(void *, size_t, size_t) override
+    void do_deallocate(void *, std::size_t, size_t) override
     { assert(false); }
 
     bool do_is_equal(ex::memory_resource const &) const noexcept override

diff  --git a/libcxx/test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp
index 8ac9b8bfe6979..fd38ffeaf0b94 100644
--- a/libcxx/test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp
+++ b/libcxx/test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp
@@ -32,10 +32,10 @@ namespace ex = std::experimental::pmr;
 struct assert_on_compare : public ex::memory_resource
 {
 protected:
-    void * do_allocate(size_t, size_t) override
+    void * do_allocate(std::size_t, size_t) override
     { assert(false); return nullptr; }
 
-    void do_deallocate(void *, size_t, size_t) override
+    void do_deallocate(void *, std::size_t, size_t) override
     { assert(false); }
 
     bool do_is_equal(ex::memory_resource const &) const noexcept override

diff  --git a/libcxx/test/std/experimental/simd/simd.cons/broadcast.pass.cpp b/libcxx/test/std/experimental/simd/simd.cons/broadcast.pass.cpp
index 02dd00379691d..edf6ba5005921 100644
--- a/libcxx/test/std/experimental/simd/simd.cons/broadcast.pass.cpp
+++ b/libcxx/test/std/experimental/simd/simd.cons/broadcast.pass.cpp
@@ -73,7 +73,7 @@ void compile_unsigned() {
 template <typename SimdType>
 void test_broadcast() {
   SimdType a(3);
-  for (size_t i = 0; i < a.size(); i++) {
+  for (std::size_t i = 0; i < a.size(); i++) {
     assert(a[i] == 3);
   }
 }

diff  --git a/libcxx/test/std/experimental/simd/simd.cons/generator.pass.cpp b/libcxx/test/std/experimental/simd/simd.cons/generator.pass.cpp
index 5049d9b0de9a0..b28e1af29a89e 100644
--- a/libcxx/test/std/experimental/simd/simd.cons/generator.pass.cpp
+++ b/libcxx/test/std/experimental/simd/simd.cons/generator.pass.cpp
@@ -38,8 +38,8 @@ template <class T>
 void supported_simd128_ctor(...) = delete;
 
 struct identity {
-  template <size_t value>
-  int operator()(std::integral_constant<size_t, value>) const {
+  template <std::size_t value>
+  int operator()(std::integral_constant<std::size_t, value>) const {
     return value;
   }
 };
@@ -52,9 +52,9 @@ void compile_generator() {
 }
 
 struct limited_identity {
-  template <size_t value>
+  template <std::size_t value>
   typename std::conditional<value <= 2, std::int32_t, std::int64_t>::type
-  operator()(std::integral_constant<size_t, value>) const {
+  operator()(std::integral_constant<std::size_t, value>) const {
     return value;
   }
 };

diff  --git a/libcxx/test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/hash.pass.cpp b/libcxx/test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/hash.pass.cpp
index 01db1a8e91fef..65208ffd8b1fb 100644
--- a/libcxx/test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/hash.pass.cpp
+++ b/libcxx/test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/hash.pass.cpp
@@ -24,7 +24,7 @@ template <> struct hash<X>
 {
   typedef X first_argument_type;
 
-  size_t operator()(const first_argument_type&) const
+  std::size_t operator()(const first_argument_type&) const
   {
     return 99;
   }

diff  --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp
index 365aa1cce9a1d..504616c106652 100644
--- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp
@@ -131,7 +131,7 @@ void test_compare_basic()
       auto h2 = hash_value(p2);
       assert((h1 == h2) == (p1 == p2));
       // check signature
-      ASSERT_SAME_TYPE(size_t, decltype(hash_value(p1)));
+      ASSERT_SAME_TYPE(std::size_t, decltype(hash_value(p1)));
       ASSERT_NOEXCEPT(hash_value(p1));
     }
     { // check std::hash
@@ -139,7 +139,7 @@ void test_compare_basic()
       auto h2 = std::hash<fs::path>()(p2);
       assert((h1 == h2) == (p1 == p2));
       // check signature
-      ASSERT_SAME_TYPE(size_t, decltype(std::hash<fs::path>()(p1)));
+      ASSERT_SAME_TYPE(std::size_t, decltype(std::hash<fs::path>()(p1)));
       ASSERT_NOEXCEPT(std::hash<fs::path>()(p1));
     }
   }

diff  --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp
index 1f3003a0945d7..179c2cd464819 100644
--- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp
@@ -54,7 +54,7 @@ void test_hex(const char *expected)
     ss << std::hex << static_cast<T>(-1);
 
     std::string str = ss.str();
-    for (size_t i = 0; i < str.size(); ++i )
+    for (std::size_t i = 0; i < str.size(); ++i )
         str[i] = static_cast<char>(std::toupper(str[i]));
 
     assert(str == expected);

diff  --git a/libcxx/test/std/iterators/iterator.container/data.pass.cpp b/libcxx/test/std/iterators/iterator.container/data.pass.cpp
index 72c4b656fdba5..1a6af4a95054d 100644
--- a/libcxx/test/std/iterators/iterator.container/data.pass.cpp
+++ b/libcxx/test/std/iterators/iterator.container/data.pass.cpp
@@ -54,7 +54,7 @@ void test_container( std::initializer_list<T>& c)
     assert ( std::data(c)   == c.begin());
 }
 
-template<typename T, size_t Sz>
+template<typename T, std::size_t Sz>
 void test_const_array( const T (&array)[Sz] )
 {
     ASSERT_NOEXCEPT(std::data(array));

diff  --git a/libcxx/test/std/iterators/iterator.container/empty.pass.cpp b/libcxx/test/std/iterators/iterator.container/empty.pass.cpp
index 1e1c0e42cbcc3..1a00e88d22b15 100644
--- a/libcxx/test/std/iterators/iterator.container/empty.pass.cpp
+++ b/libcxx/test/std/iterators/iterator.container/empty.pass.cpp
@@ -53,7 +53,7 @@ void test_container( std::initializer_list<T>& c )
     assert ( std::empty(c)   == (c.size() == 0));
 }
 
-template<typename T, size_t Sz>
+template<typename T, std::size_t Sz>
 void test_const_array( const T (&array)[Sz] )
 {
     ASSERT_NOEXCEPT(std::empty(array));

diff  --git a/libcxx/test/std/iterators/iterator.container/size.pass.cpp b/libcxx/test/std/iterators/iterator.container/size.pass.cpp
index 697119a3239f9..975d3e80c2b78 100644
--- a/libcxx/test/std/iterators/iterator.container/size.pass.cpp
+++ b/libcxx/test/std/iterators/iterator.container/size.pass.cpp
@@ -54,7 +54,7 @@ void test_container( std::initializer_list<T>& c )
     assert ( std::size(c)   == c.size());
 }
 
-template<typename T, size_t Sz>
+template<typename T, std::size_t Sz>
 void test_const_array( const T (&array)[Sz] )
 {
     ASSERT_NOEXCEPT(std::size(array));

diff  --git a/libcxx/test/std/iterators/iterator.container/ssize.pass.cpp b/libcxx/test/std/iterators/iterator.container/ssize.pass.cpp
index 779e9ed8aa9dc..9be44094a099c 100644
--- a/libcxx/test/std/iterators/iterator.container/ssize.pass.cpp
+++ b/libcxx/test/std/iterators/iterator.container/ssize.pass.cpp
@@ -65,7 +65,7 @@ void test_container(std::initializer_list<T>& c)
     assert ( std::ssize(c)   == static_cast<decltype(std::ssize(c))>(c.size()));
 }
 
-template<typename T, size_t Sz>
+template<typename T, std::size_t Sz>
 void test_const_array(const T (&array)[Sz])
 {
     ASSERT_NOEXCEPT(std::ssize(array));

diff  --git a/libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.hash/hash.pass.cpp b/libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.hash/hash.pass.cpp
index 6d5b9e98c4e46..1e3aed28800f1 100644
--- a/libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.hash/hash.pass.cpp
+++ b/libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.hash/hash.pass.cpp
@@ -30,8 +30,8 @@
 
 template <class C>
 void do_test(int *LHSVal, int *RHSVal) {
-  [[maybe_unused]] const size_t ExpectLHS = std::hash<void*>{}(LHSVal);
-  [[maybe_unused]] const size_t ExpectRHS = std::hash<void*>{}(RHSVal);
+  [[maybe_unused]] const std::size_t ExpectLHS = std::hash<void*>{}(LHSVal);
+  [[maybe_unused]] const std::size_t ExpectRHS = std::hash<void*>{}(RHSVal);
   const C LHS = C::from_address(LHSVal);
   const C RHS = C::from_address(RHSVal);
   const std::hash<C> h;
@@ -40,7 +40,7 @@ void do_test(int *LHSVal, int *RHSVal) {
   LIBCPP_ASSERT(h(RHS) == ExpectRHS);
   assert((h(LHS) == h(RHS)) == (LHSVal == RHSVal));
   {
-    ASSERT_SAME_TYPE(decltype(h(LHS)), size_t);
+    ASSERT_SAME_TYPE(decltype(h(LHS)), std::size_t);
     ASSERT_NOEXCEPT(std::hash<C>{}(LHS));
   }
 }

diff  --git a/libcxx/test/std/language.support/support.runtime/cstdlib.pass.cpp b/libcxx/test/std/language.support/support.runtime/cstdlib.pass.cpp
index c4c8ddd318094..823417f8a418e 100644
--- a/libcxx/test/std/language.support/support.runtime/cstdlib.pass.cpp
+++ b/libcxx/test/std/language.support/support.runtime/cstdlib.pass.cpp
@@ -78,7 +78,7 @@ void test_abs() {
     static_assert(!has_abs<unsigned>::value, "");
     static_assert(!has_abs<unsigned long>::value, "");
     static_assert(!has_abs<unsigned long long>::value, "");
-    static_assert(!has_abs<size_t>::value, "");
+    static_assert(!has_abs<std::size_t>::value, "");
 
     TEST_DIAGNOSTIC_POP
 

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/classic_table.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/classic_table.pass.cpp
index 7f85dee329a67..8fe8080bde98f 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/classic_table.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/classic_table.pass.cpp
@@ -26,7 +26,7 @@ int main(int, char**)
     typedef F::mask mask;
     const mask *p = F::classic_table();
 
-    for ( size_t i = 0; i < 128; ++i ) // values above 128 are not consistent
+    for ( std::size_t i = 0; i < 128; ++i ) // values above 128 are not consistent
     {
 
         bool expect_cntrl = (i < 32 || 126 < i);

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/table_size.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/table_size.pass.cpp
index 4017b94eed278..57fab12796078 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/table_size.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/table_size.pass.cpp
@@ -24,7 +24,7 @@
 
 int main(int, char**) {
   typedef std::ctype<char> F;
-  const size_t* G = &F::table_size;
+  const std::size_t* G = &F::table_size;
   assert(*G >= 256);
 
   return 0;

diff  --git a/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp b/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp
index 5aa2fe6bbbe9f..5eb7c92daec2a 100644
--- a/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp
@@ -84,7 +84,7 @@ void test_negate() {
         ++value;
         std::string std_str = make_neg_string(value);
         const char* str = std_str.data();
-        size_t size = std_str.size();
+        std::size_t size = std_str.size();
         std::ios_base::iostate err = ios.goodbit;
         cpp17_input_iterator<const char*> iter =
             f.get(cpp17_input_iterator<const char*>(str),
@@ -102,7 +102,7 @@ void test_negate() {
         ++value;
         std::string std_str = make_neg_string(value);
         const char* str = std_str.data();
-        size_t size = std_str.size();
+        std::size_t size = std_str.size();
         std::ios_base::iostate err = ios.goodbit;
         cpp17_input_iterator<const char*> iter =
             f.get(cpp17_input_iterator<const char*>(str),
@@ -118,7 +118,7 @@ void test_negate() {
         T value = std::numeric_limits<T>::max();
         std::string std_str = make_neg_string(value);
         const char* str = std_str.data();
-        size_t size = std_str.size();
+        std::size_t size = std_str.size();
         std::ios_base::iostate err = ios.goodbit;
         cpp17_input_iterator<const char*> iter =
             f.get(cpp17_input_iterator<const char*>(str),
@@ -134,7 +134,7 @@ void test_negate() {
         std::string std_str = make_neg_string(std::numeric_limits<T>::max());
         std_str.back()++;
         const char* str = std_str.data();
-        size_t size = std_str.size();
+        std::size_t size = std_str.size();
         std::ios_base::iostate err = ios.goodbit;
         cpp17_input_iterator<const char*> iter =
             f.get(cpp17_input_iterator<const char*>(str),

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_length.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_length.pass.cpp
index 53172e7d630ba..bf2f8af6e8428 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_length.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_length.pass.cpp
@@ -26,7 +26,7 @@
 
 #include "test_macros.h"
 
-template <class CharT, size_t = sizeof(CharT)>
+template <class CharT, std::size_t = sizeof(CharT)>
 struct TestHelper;
 
 template <class CharT>

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp
index ac3daf40987b2..e9c19e51b24e6 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp
@@ -25,7 +25,7 @@
 
 #include "test_macros.h"
 
-template <class CharT, size_t = sizeof(CharT)>
+template <class CharT, std::size_t = sizeof(CharT)>
 struct TestHelper;
 
 template <class CharT>

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp
index 2a6936aee10ca..24b1d22881b47 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp
@@ -28,7 +28,7 @@
 
 #include "test_macros.h"
 
-template <class CharT, size_t = sizeof(CharT)>
+template <class CharT, std::size_t = sizeof(CharT)>
 struct TestHelper;
 template <class CharT>
 struct TestHelper<CharT, 2> {

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp
index 37cc10aa90b7a..0d52894282bd0 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp
@@ -26,7 +26,7 @@
 
 #include "test_macros.h"
 
-template <class CharT, size_t = sizeof(CharT)>
+template <class CharT, std::size_t = sizeof(CharT)>
 struct TestHelper;
 
 template <class CharT>

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp
index 6279dceeb2eb5..32fdde30153ec 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp
@@ -25,7 +25,7 @@
 
 #include "test_macros.h"
 
-template <class CharT, size_t = sizeof(CharT)>
+template <class CharT, std::size_t = sizeof(CharT)>
 struct TestHelper;
 
 template <class CharT>

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp
index 7d124c982e5ec..22636ca08980c 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp
@@ -28,7 +28,7 @@
 
 #include "test_macros.h"
 
-template <class CharT, size_t = sizeof(CharT)>
+template <class CharT, std::size_t = sizeof(CharT)>
 struct TestHelper;
 
 template <class CharT>

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp
index d7776b3a2d899..24eb2dff6182c 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp
@@ -28,7 +28,7 @@
 
 #include "test_macros.h"
 
-template <class CharT, size_t = sizeof(CharT)>
+template <class CharT, std::size_t = sizeof(CharT)>
 struct TestHelper;
 template <class CharT>
 struct TestHelper<CharT, 2> {

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp
index c208dc33b0f2a..b9eeb6adc9c86 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp
@@ -28,7 +28,7 @@
 
 #include "test_macros.h"
 
-template <class CharT, size_t = sizeof(CharT)>
+template <class CharT, std::size_t = sizeof(CharT)>
 struct TestHelper;
 template <class CharT>
 struct TestHelper<CharT, 2> {

diff  --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/converted.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/converted.pass.cpp
index e1b1f69e81deb..2861e4a52036e 100644
--- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/converted.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/converted.pass.cpp
@@ -22,7 +22,7 @@
 
 #include "test_macros.h"
 
-template <class CharT, size_t = sizeof(CharT)>
+template <class CharT, std::size_t = sizeof(CharT)>
 struct TestHelper;
 template <class CharT>
 struct TestHelper<CharT, 2> {

diff  --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/from_bytes.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/from_bytes.pass.cpp
index 157b7454153bd..ac614b087b90a 100644
--- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/from_bytes.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/from_bytes.pass.cpp
@@ -25,7 +25,7 @@
 
 #include "test_macros.h"
 
-template <class CharT, size_t = sizeof(CharT)>
+template <class CharT, std::size_t = sizeof(CharT)>
 struct TestHelper;
 template <class CharT>
 struct TestHelper<CharT, 2> {

diff  --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/to_bytes.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/to_bytes.pass.cpp
index 52c5897634d04..4f3b9318c2f35 100644
--- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/to_bytes.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/to_bytes.pass.cpp
@@ -25,7 +25,7 @@
 
 #include "test_macros.h"
 
-template <class CharT, size_t = sizeof(CharT)>
+template <class CharT, std::size_t = sizeof(CharT)>
 struct TestHelper;
 template <class CharT>
 struct TestHelper<CharT, 2> {

diff  --git a/libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.fail.cpp b/libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.fail.cpp
index c768d0fa9de26..1d4699c18d8ea 100644
--- a/libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.fail.cpp
+++ b/libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.fail.cpp
@@ -43,7 +43,7 @@ int main(int, char**)
     static_assert(toobig<std::uint16_t>(), "");  // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
     static_assert(toobig<std::uint32_t>(), "");  // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
     static_assert(toobig<std::uint64_t>(), "");  // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
-    static_assert(toobig<size_t>(), "");    // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
+    static_assert(toobig<std::size_t>(), "");    // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
     static_assert(toobig<uintmax_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
     static_assert(toobig<uintptr_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
 

diff  --git a/libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.pass.cpp b/libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.pass.cpp
index 7aa1265838dbb..0da878d0b1f17 100644
--- a/libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.pass.cpp
+++ b/libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.pass.cpp
@@ -121,7 +121,7 @@ int main(int, char**)
     static_assert(test<std::uint64_t>());
     static_assert(test<uintmax_t>());
     static_assert(test<uintptr_t>());
-    static_assert(test<size_t>());
+    static_assert(test<std::size_t>());
 
     test<unsigned char>();
     test<unsigned short>();
@@ -137,7 +137,7 @@ int main(int, char**)
     test<std::uint64_t>();
     test<uintmax_t>();
     test<uintptr_t>();
-    test<size_t>();
+    test<std::size_t>();
 
     return 0;
 }

diff  --git a/libcxx/test/std/numerics/bit/bit.pow.two/bit_floor.pass.cpp b/libcxx/test/std/numerics/bit/bit.pow.two/bit_floor.pass.cpp
index 7b8d67c6152f0..41d5ed1e06017 100644
--- a/libcxx/test/std/numerics/bit/bit.pow.two/bit_floor.pass.cpp
+++ b/libcxx/test/std/numerics/bit/bit.pow.two/bit_floor.pass.cpp
@@ -119,7 +119,7 @@ int main(int, char**)
     static_assert(test<std::uint64_t>());
     static_assert(test<uintmax_t>());
     static_assert(test<uintptr_t>());
-    static_assert(test<size_t>());
+    static_assert(test<std::size_t>());
 
     test<unsigned char>();
     test<unsigned short>();
@@ -136,7 +136,7 @@ int main(int, char**)
     test<std::uint64_t>();
     test<uintmax_t>();
     test<uintptr_t>();
-    test<size_t>();
+    test<std::size_t>();
 
     return 0;
 }

diff  --git a/libcxx/test/std/numerics/bit/bit.pow.two/bit_width.pass.cpp b/libcxx/test/std/numerics/bit/bit.pow.two/bit_width.pass.cpp
index 899d272f56d7c..53fdec6bd2076 100644
--- a/libcxx/test/std/numerics/bit/bit.pow.two/bit_width.pass.cpp
+++ b/libcxx/test/std/numerics/bit/bit.pow.two/bit_width.pass.cpp
@@ -123,7 +123,7 @@ int main(int, char**)
     static_assert(test<std::uint64_t>());
     static_assert(test<uintmax_t>());
     static_assert(test<uintptr_t>());
-    static_assert(test<size_t>());
+    static_assert(test<std::size_t>());
 
     test<unsigned char>();
     test<unsigned short>();
@@ -139,7 +139,7 @@ int main(int, char**)
     test<std::uint64_t>();
     test<uintmax_t>();
     test<uintptr_t>();
-    test<size_t>();
+    test<std::size_t>();
 
     return 0;
 }

diff  --git a/libcxx/test/std/numerics/bit/bit.pow.two/has_single_bit.pass.cpp b/libcxx/test/std/numerics/bit/bit.pow.two/has_single_bit.pass.cpp
index 2c33bda72982c..044a87fa41352 100644
--- a/libcxx/test/std/numerics/bit/bit.pow.two/has_single_bit.pass.cpp
+++ b/libcxx/test/std/numerics/bit/bit.pow.two/has_single_bit.pass.cpp
@@ -121,7 +121,7 @@ int main(int, char**)
     static_assert(test<std::uint64_t>());
     static_assert(test<uintmax_t>());
     static_assert(test<uintptr_t>());
-    static_assert(test<size_t>());
+    static_assert(test<std::size_t>());
 
     test<unsigned char>();
     test<unsigned short>();
@@ -137,7 +137,7 @@ int main(int, char**)
     test<std::uint64_t>();
     test<uintmax_t>();
     test<uintptr_t>();
-    test<size_t>();
+    test<std::size_t>();
 
     return 0;
 }

diff  --git a/libcxx/test/std/numerics/bit/bitops.count/countl_one.pass.cpp b/libcxx/test/std/numerics/bit/bitops.count/countl_one.pass.cpp
index f9def0a4d3407..06a8a6d6cc879 100644
--- a/libcxx/test/std/numerics/bit/bitops.count/countl_one.pass.cpp
+++ b/libcxx/test/std/numerics/bit/bitops.count/countl_one.pass.cpp
@@ -118,7 +118,7 @@ int main(int, char**)
     static_assert(test<std::uint64_t>());
     static_assert(test<uintmax_t>());
     static_assert(test<uintptr_t>());
-    static_assert(test<size_t>());
+    static_assert(test<std::size_t>());
 
     test<unsigned char>();
     test<unsigned short>();
@@ -134,7 +134,7 @@ int main(int, char**)
     test<std::uint64_t>();
     test<uintmax_t>();
     test<uintptr_t>();
-    test<size_t>();
+    test<std::size_t>();
 
     return 0;
 }

diff  --git a/libcxx/test/std/numerics/bit/bitops.count/countl_zero.pass.cpp b/libcxx/test/std/numerics/bit/bitops.count/countl_zero.pass.cpp
index b76731eeb0469..5a30e57c409a6 100644
--- a/libcxx/test/std/numerics/bit/bitops.count/countl_zero.pass.cpp
+++ b/libcxx/test/std/numerics/bit/bitops.count/countl_zero.pass.cpp
@@ -117,7 +117,7 @@ int main(int, char**)
     static_assert(test<std::uint64_t>());
     static_assert(test<uintmax_t>());
     static_assert(test<uintptr_t>());
-    static_assert(test<size_t>());
+    static_assert(test<std::size_t>());
 
     test<unsigned char>();
     test<unsigned short>();
@@ -133,7 +133,7 @@ int main(int, char**)
     test<std::uint64_t>();
     test<uintmax_t>();
     test<uintptr_t>();
-    test<size_t>();
+    test<std::size_t>();
 
     return 0;
 }

diff  --git a/libcxx/test/std/numerics/bit/bitops.count/countr_one.pass.cpp b/libcxx/test/std/numerics/bit/bitops.count/countr_one.pass.cpp
index c1a9a4a0ebb5f..1698e31086ea4 100644
--- a/libcxx/test/std/numerics/bit/bitops.count/countr_one.pass.cpp
+++ b/libcxx/test/std/numerics/bit/bitops.count/countr_one.pass.cpp
@@ -122,7 +122,7 @@ int main(int, char**)
     static_assert(test<std::uint64_t>());
     static_assert(test<uintmax_t>());
     static_assert(test<uintptr_t>());
-    static_assert(test<size_t>());
+    static_assert(test<std::size_t>());
 
     test<unsigned char>();
     test<unsigned short>();
@@ -138,7 +138,7 @@ int main(int, char**)
     test<std::uint64_t>();
     test<uintmax_t>();
     test<uintptr_t>();
-    test<size_t>();
+    test<std::size_t>();
 
     return 0;
 }

diff  --git a/libcxx/test/std/numerics/bit/bitops.count/countr_zero.pass.cpp b/libcxx/test/std/numerics/bit/bitops.count/countr_zero.pass.cpp
index 639144309454c..91fbab8bbed84 100644
--- a/libcxx/test/std/numerics/bit/bitops.count/countr_zero.pass.cpp
+++ b/libcxx/test/std/numerics/bit/bitops.count/countr_zero.pass.cpp
@@ -119,7 +119,7 @@ int main(int, char**)
     static_assert(test<std::uint64_t>());
     static_assert(test<uintmax_t>());
     static_assert(test<uintptr_t>());
-    static_assert(test<size_t>());
+    static_assert(test<std::size_t>());
 
     test<unsigned char>();
     test<unsigned short>();
@@ -135,7 +135,7 @@ int main(int, char**)
     test<std::uint64_t>();
     test<uintmax_t>();
     test<uintptr_t>();
-    test<size_t>();
+    test<std::size_t>();
 
     return 0;
 }

diff  --git a/libcxx/test/std/numerics/bit/bitops.count/popcount.pass.cpp b/libcxx/test/std/numerics/bit/bitops.count/popcount.pass.cpp
index 6b996ed5177a9..00e60ff588176 100644
--- a/libcxx/test/std/numerics/bit/bitops.count/popcount.pass.cpp
+++ b/libcxx/test/std/numerics/bit/bitops.count/popcount.pass.cpp
@@ -129,7 +129,7 @@ int main(int, char**)
     static_assert(test<std::uint64_t>());
     static_assert(test<uintmax_t>());
     static_assert(test<uintptr_t>());
-    static_assert(test<size_t>());
+    static_assert(test<std::size_t>());
 
     test<unsigned char>();
     test<unsigned short>();
@@ -145,7 +145,7 @@ int main(int, char**)
     test<std::uint64_t>();
     test<uintmax_t>();
     test<uintptr_t>();
-    test<size_t>();
+    test<std::size_t>();
 
     return 0;
 }

diff  --git a/libcxx/test/std/numerics/bit/bitops.rot/rotl.pass.cpp b/libcxx/test/std/numerics/bit/bitops.rot/rotl.pass.cpp
index 34859ae922197..5fe63e47403c4 100644
--- a/libcxx/test/std/numerics/bit/bitops.rot/rotl.pass.cpp
+++ b/libcxx/test/std/numerics/bit/bitops.rot/rotl.pass.cpp
@@ -118,7 +118,7 @@ int main(int, char**)
     static_assert(test<std::uint64_t>());
     static_assert(test<uintmax_t>());
     static_assert(test<uintptr_t>());
-    static_assert(test<size_t>());
+    static_assert(test<std::size_t>());
 
     test<unsigned char>();
     test<unsigned short>();
@@ -135,7 +135,7 @@ int main(int, char**)
     test<std::uint64_t>();
     test<uintmax_t>();
     test<uintptr_t>();
-    test<size_t>();
+    test<std::size_t>();
 
     return 0;
 }

diff  --git a/libcxx/test/std/numerics/bit/bitops.rot/rotr.pass.cpp b/libcxx/test/std/numerics/bit/bitops.rot/rotr.pass.cpp
index a6851e72a5ad6..1b63540cd8c45 100644
--- a/libcxx/test/std/numerics/bit/bitops.rot/rotr.pass.cpp
+++ b/libcxx/test/std/numerics/bit/bitops.rot/rotr.pass.cpp
@@ -119,7 +119,7 @@ int main(int, char**)
     static_assert(test<std::uint64_t>());
     static_assert(test<uintmax_t>());
     static_assert(test<uintptr_t>());
-    static_assert(test<size_t>());
+    static_assert(test<std::size_t>());
 
     test<unsigned char>();
     test<unsigned short>();
@@ -136,7 +136,7 @@ int main(int, char**)
     test<std::uint64_t>();
     test<uintmax_t>();
     test<uintptr_t>();
-    test<size_t>();
+    test<std::size_t>();
 
     return 0;
 }

diff  --git a/libcxx/test/std/numerics/c.math/cmath.pass.cpp b/libcxx/test/std/numerics/c.math/cmath.pass.cpp
index c867472662150..e2062cc7ecfd9 100644
--- a/libcxx/test/std/numerics/c.math/cmath.pass.cpp
+++ b/libcxx/test/std/numerics/c.math/cmath.pass.cpp
@@ -133,7 +133,7 @@ void test_abs()
     static_assert(!has_abs<unsigned>::value, "");
     static_assert(!has_abs<unsigned long>::value, "");
     static_assert(!has_abs<unsigned long long>::value, "");
-    static_assert(!has_abs<size_t>::value, "");
+    static_assert(!has_abs<std::size_t>::value, "");
 
     TEST_DIAGNOSTIC_POP
 

diff  --git a/libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/deduct.pass.cpp b/libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/deduct.pass.cpp
index 80ac2ae0fd636..e664b6acd5fd9 100644
--- a/libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/deduct.pass.cpp
+++ b/libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/deduct.pass.cpp
@@ -64,7 +64,7 @@ int main(int, char**)
     {
         // From (indirect_array<T>)
         std::valarray<long> v = {1, 2, 3, 4, 5};
-        std::valarray<size_t> i = {1, 2, 3};
+        std::valarray<std::size_t> i = {1, 2, 3};
         std::valarray v2 = v[i];
         static_assert(std::is_same_v<decltype(v2), std::valarray<long>>);
     }

diff  --git a/libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/size.pass.cpp b/libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/size.pass.cpp
index 4c87bd4e816ca..21d4ee15f57c6 100644
--- a/libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/size.pass.cpp
+++ b/libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/size.pass.cpp
@@ -21,7 +21,7 @@ struct S {
     S() : x(1) {}
     ~S() { ++cnt_dtor; }
     int x;
-    static size_t cnt_dtor;
+    static std::size_t cnt_dtor;
 };
 
 size_t S::cnt_dtor = 0;

diff  --git a/libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp b/libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp
index 69f25fcbc3c6b..bef2dd7866964 100644
--- a/libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp
+++ b/libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp
@@ -57,33 +57,33 @@ test()
     }
 }
 
-constexpr size_t triangle(size_t n) { return n*(n+1)/2; }
+constexpr std::size_t triangle(size_t n) { return n*(n+1)/2; }
 
 //  Basic sanity
 TEST_CONSTEXPR_CXX20 void
 basic_tests()
 {
     {
-    std::array<size_t, 10> v;
+    std::array<std::size_t, 10> v;
     std::fill(v.begin(), v.end(), 3);
-    std::exclusive_scan(v.begin(), v.end(), v.begin(), size_t{50});
-    for (size_t i = 0; i < v.size(); ++i)
+    std::exclusive_scan(v.begin(), v.end(), v.begin(), std::size_t{50});
+    for (std::size_t i = 0; i < v.size(); ++i)
         assert(v[i] == 50 + i * 3);
     }
 
     {
-    std::array<size_t, 10> v;
+    std::array<std::size_t, 10> v;
     std::iota(v.begin(), v.end(), 0);
-    std::exclusive_scan(v.begin(), v.end(), v.begin(), size_t{30});
-    for (size_t i = 0; i < v.size(); ++i)
+    std::exclusive_scan(v.begin(), v.end(), v.begin(), std::size_t{30});
+    for (std::size_t i = 0; i < v.size(); ++i)
         assert(v[i] == 30 + triangle(i-1));
     }
 
     {
-    std::array<size_t, 10> v;
+    std::array<std::size_t, 10> v;
     std::iota(v.begin(), v.end(), 1);
-    std::exclusive_scan(v.begin(), v.end(), v.begin(), size_t{40});
-    for (size_t i = 0; i < v.size(); ++i)
+    std::exclusive_scan(v.begin(), v.end(), v.begin(), std::size_t{40});
+    for (std::size_t i = 0; i < v.size(); ++i)
         assert(v[i] == 40 + triangle(i));
     }
 

diff  --git a/libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp b/libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp
index 53698b1d7b2e1..ca2de4aec1600 100644
--- a/libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp
+++ b/libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp
@@ -77,13 +77,13 @@ test()
     {
     std::array<unsigned char, 10> v;
     std::iota(v.begin(), v.end(), static_cast<unsigned char>(1));
-    std::array<size_t, 10> res;
+    std::array<std::size_t, 10> res;
     std::exclusive_scan(v.begin(), v.end(), res.begin(), 1, std::multiplies<>());
 
     assert(res.size() == 10);
-    size_t j = 1;
+    std::size_t j = 1;
     assert(res[0] == 1);
-    for (size_t i = 1; i < v.size(); ++i)
+    for (std::size_t i = 1; i < v.size(); ++i)
     {
         j *= i;
         assert(res[i] == j);

diff  --git a/libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp b/libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp
index 6e005060cbda5..299d085d01a06 100644
--- a/libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp
+++ b/libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp
@@ -58,38 +58,38 @@ test()
     }
 }
 
-constexpr size_t triangle(size_t n) { return n*(n+1)/2; }
+constexpr std::size_t triangle(size_t n) { return n*(n+1)/2; }
 
 //  Basic sanity
 TEST_CONSTEXPR_CXX20 void
 basic_tests()
 {
     {
-    std::array<size_t, 10> v;
+    std::array<std::size_t, 10> v;
     std::fill(v.begin(), v.end(), 3);
     std::inclusive_scan(v.begin(), v.end(), v.begin());
-    for (size_t i = 0; i < v.size(); ++i)
+    for (std::size_t i = 0; i < v.size(); ++i)
         assert(v[i] == (i+1) * 3);
     }
 
     {
-    std::array<size_t, 10> v;
+    std::array<std::size_t, 10> v;
     std::iota(v.begin(), v.end(), 0);
     std::inclusive_scan(v.begin(), v.end(), v.begin());
-    for (size_t i = 0; i < v.size(); ++i)
+    for (std::size_t i = 0; i < v.size(); ++i)
         assert(v[i] == triangle(i));
     }
 
     {
-    std::array<size_t, 10> v;
+    std::array<std::size_t, 10> v;
     std::iota(v.begin(), v.end(), 1);
     std::inclusive_scan(v.begin(), v.end(), v.begin());
-    for (size_t i = 0; i < v.size(); ++i)
+    for (std::size_t i = 0; i < v.size(); ++i)
         assert(v[i] == triangle(i + 1));
     }
 
     {
-    std::array<size_t, 0> v, res;
+    std::array<std::size_t, 0> v, res;
     std::inclusive_scan(v.begin(), v.end(), res.begin());
     assert(res.empty());
     }

diff  --git a/libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp b/libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp
index 5e33394f7483e..87bea923eed3f 100644
--- a/libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp
+++ b/libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp
@@ -62,38 +62,38 @@ test()
     }
 }
 
-constexpr size_t triangle(size_t n) { return n*(n+1)/2; }
+constexpr std::size_t triangle(size_t n) { return n*(n+1)/2; }
 
 //  Basic sanity
 TEST_CONSTEXPR_CXX20 void
 basic_tests()
 {
     {
-    std::array<size_t, 10> v;
+    std::array<std::size_t, 10> v;
     std::fill(v.begin(), v.end(), 3);
     std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>());
-    for (size_t i = 0; i < v.size(); ++i)
+    for (std::size_t i = 0; i < v.size(); ++i)
         assert(v[i] == (i+1) * 3);
     }
 
     {
-    std::array<size_t, 10> v;
+    std::array<std::size_t, 10> v;
     std::iota(v.begin(), v.end(), 0);
     std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>());
-    for (size_t i = 0; i < v.size(); ++i)
+    for (std::size_t i = 0; i < v.size(); ++i)
         assert(v[i] == triangle(i));
     }
 
     {
-    std::array<size_t, 10> v;
+    std::array<std::size_t, 10> v;
     std::iota(v.begin(), v.end(), 1);
     std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>());
-    for (size_t i = 0; i < v.size(); ++i)
+    for (std::size_t i = 0; i < v.size(); ++i)
         assert(v[i] == triangle(i + 1));
     }
 
     {
-    std::array<size_t, 0> v, res;
+    std::array<std::size_t, 0> v, res;
     std::inclusive_scan(v.begin(), v.end(), res.begin(), std::plus<>());
     assert(res.empty());
     }

diff  --git a/libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp b/libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp
index f7c2be2c66316..2e21d38f47344 100644
--- a/libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp
+++ b/libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp
@@ -62,39 +62,39 @@ test()
     }
 }
 
-constexpr size_t triangle(size_t n) { return n*(n+1)/2; }
+constexpr std::size_t triangle(size_t n) { return n*(n+1)/2; }
 
 //  Basic sanity
 TEST_CONSTEXPR_CXX20 void
 basic_tests()
 {
     {
-    std::array<size_t, 10> v;
+    std::array<std::size_t, 10> v;
     std::fill(v.begin(), v.end(), 3);
-    std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), size_t{50});
-    for (size_t i = 0; i < v.size(); ++i)
+    std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), std::size_t{50});
+    for (std::size_t i = 0; i < v.size(); ++i)
         assert(v[i] == 50 + (i+1) * 3);
     }
 
     {
-    std::array<size_t, 10> v;
+    std::array<std::size_t, 10> v;
     std::iota(v.begin(), v.end(), 0);
-    std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), size_t{40});
-    for (size_t i = 0; i < v.size(); ++i)
+    std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), std::size_t{40});
+    for (std::size_t i = 0; i < v.size(); ++i)
         assert(v[i] == 40 + triangle(i));
     }
 
     {
-    std::array<size_t, 10> v;
+    std::array<std::size_t, 10> v;
     std::iota(v.begin(), v.end(), 1);
-    std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), size_t{30});
-    for (size_t i = 0; i < v.size(); ++i)
+    std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), std::size_t{30});
+    for (std::size_t i = 0; i < v.size(); ++i)
         assert(v[i] == 30 + triangle(i + 1));
     }
 
     {
-    std::array<size_t, 0> v, res;
-    std::inclusive_scan(v.begin(), v.end(), res.begin(), std::plus<>(), size_t{40});
+    std::array<std::size_t, 0> v, res;
+    std::inclusive_scan(v.begin(), v.end(), res.begin(), std::plus<>(), std::size_t{40});
     assert(res.empty());
     }
 
@@ -102,13 +102,13 @@ basic_tests()
     {
     std::array<unsigned char, 10> v;
     std::iota(v.begin(), v.end(), static_cast<unsigned char>(1));
-    std::array<size_t, 10> res;
-    std::inclusive_scan(v.begin(), v.end(), res.begin(), std::multiplies<>(), size_t{1});
+    std::array<std::size_t, 10> res;
+    std::inclusive_scan(v.begin(), v.end(), res.begin(), std::multiplies<>(), std::size_t{1});
 
     assert(res.size() == 10);
-    size_t j = 1;
+    std::size_t j = 1;
     assert(res[0] == 1);
-    for (size_t i = 1; i < v.size(); ++i)
+    for (std::size_t i = 1; i < v.size(); ++i)
     {
         j *= i + 1;
         assert(res[i] == j);

diff  --git a/libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.integer.pass.cpp b/libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.integer.pass.cpp
index 1862045a4ec90..03f3bdaf2d561 100644
--- a/libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.integer.pass.cpp
+++ b/libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.integer.pass.cpp
@@ -138,7 +138,7 @@ int main(int, char**)
 
 //     int_test<char>();
     signed_test<ptr
diff _t>();
-    unsigned_test<size_t>();
+    unsigned_test<std::size_t>();
 
     return 0;
 }

diff  --git a/libcxx/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp b/libcxx/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp
index 9ab546a06d85b..52272205307a9 100644
--- a/libcxx/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp
+++ b/libcxx/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp
@@ -88,39 +88,39 @@ test()
     }
 }
 
-constexpr size_t triangle(size_t n) { return n*(n+1)/2; }
+constexpr std::size_t triangle(size_t n) { return n*(n+1)/2; }
 
 //  Basic sanity
 TEST_CONSTEXPR_CXX20 void
 basic_tests()
 {
     {
-    std::array<size_t, 10> v;
+    std::array<std::size_t, 10> v;
     std::fill(v.begin(), v.end(), 3);
-    std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), size_t{50}, std::plus<>(), add_one{});
-    for (size_t i = 0; i < v.size(); ++i)
+    std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), std::size_t{50}, std::plus<>(), add_one{});
+    for (std::size_t i = 0; i < v.size(); ++i)
         assert(v[i] == 50 + i * 4);
     }
 
     {
-    std::array<size_t, 10> v;
+    std::array<std::size_t, 10> v;
     std::iota(v.begin(), v.end(), 0);
-    std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), size_t{30}, std::plus<>(), add_one{});
-    for (size_t i = 0; i < v.size(); ++i)
+    std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), std::size_t{30}, std::plus<>(), add_one{});
+    for (std::size_t i = 0; i < v.size(); ++i)
         assert(v[i] == 30 + triangle(i - 1) + i);
     }
 
     {
-    std::array<size_t, 10> v;
+    std::array<std::size_t, 10> v;
     std::iota(v.begin(), v.end(), 1);
-    std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), size_t{40}, std::plus<>(), add_one{});
-    for (size_t i = 0; i < v.size(); ++i)
+    std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), std::size_t{40}, std::plus<>(), add_one{});
+    for (std::size_t i = 0; i < v.size(); ++i)
         assert(v[i] == 40 + triangle(i) + i);
     }
 
     {
-    std::array<size_t, 0> v, res;
-    std::transform_exclusive_scan(v.begin(), v.end(), res.begin(), size_t{40}, std::plus<>(), add_one{});
+    std::array<std::size_t, 0> v, res;
+    std::transform_exclusive_scan(v.begin(), v.end(), res.begin(), std::size_t{40}, std::plus<>(), add_one{});
     assert(res.empty());
     }
 
@@ -128,13 +128,13 @@ basic_tests()
     {
     std::array<unsigned char, 10> v;
     std::iota(v.begin(), v.end(), static_cast<unsigned char>(1));
-    std::array<size_t, 10> res;
-    std::transform_exclusive_scan(v.begin(), v.end(), res.begin(), size_t{1}, std::multiplies<>(), add_one{});
+    std::array<std::size_t, 10> res;
+    std::transform_exclusive_scan(v.begin(), v.end(), res.begin(), std::size_t{1}, std::multiplies<>(), add_one{});
 
     assert(res.size() == 10);
-    size_t j = 1;
+    std::size_t j = 1;
     assert(res[0] == 1);
-    for (size_t i = 1; i < res.size(); ++i)
+    for (std::size_t i = 1; i < res.size(); ++i)
     {
         j *= i + 1;
         assert(res[i] == j);

diff  --git a/libcxx/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp b/libcxx/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp
index d4a95bf582978..80ead01e9a795 100644
--- a/libcxx/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp
+++ b/libcxx/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp
@@ -77,38 +77,38 @@ test()
     }
 }
 
-constexpr size_t triangle(size_t n) { return n*(n+1)/2; }
+constexpr std::size_t triangle(size_t n) { return n*(n+1)/2; }
 
 //  Basic sanity
 TEST_CONSTEXPR_CXX20 void
 basic_tests()
 {
     {
-    std::array<size_t, 10> v;
+    std::array<std::size_t, 10> v;
     std::fill(v.begin(), v.end(), 3);
     std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{});
-    for (size_t i = 0; i < v.size(); ++i)
+    for (std::size_t i = 0; i < v.size(); ++i)
         assert(v[i] == (i+1) * 4);
     }
 
     {
-    std::array<size_t, 10> v;
+    std::array<std::size_t, 10> v;
     std::iota(v.begin(), v.end(), 0);
     std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{});
-    for (size_t i = 0; i < v.size(); ++i)
+    for (std::size_t i = 0; i < v.size(); ++i)
         assert(v[i] == triangle(i) + i + 1);
     }
 
     {
-    std::array<size_t, 10> v;
+    std::array<std::size_t, 10> v;
     std::iota(v.begin(), v.end(), 1);
     std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{});
-    for (size_t i = 0; i < v.size(); ++i)
+    for (std::size_t i = 0; i < v.size(); ++i)
         assert(v[i] == triangle(i + 1) + i + 1);
     }
 
     {
-    std::array<size_t, 0> v, res;
+    std::array<std::size_t, 0> v, res;
     std::transform_inclusive_scan(v.begin(), v.end(), res.begin(), std::plus<>(), add_one{});
     assert(res.empty());
     }

diff  --git a/libcxx/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp b/libcxx/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
index 7d89c5b320468..18be676c7a54d 100644
--- a/libcxx/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
+++ b/libcxx/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
@@ -90,39 +90,39 @@ test()
     }
 }
 
-constexpr size_t triangle(size_t n) { return n*(n+1)/2; }
+constexpr std::size_t triangle(size_t n) { return n*(n+1)/2; }
 
 //  Basic sanity
 TEST_CONSTEXPR_CXX20 void
 basic_tests()
 {
     {
-    std::array<size_t, 10> v;
+    std::array<std::size_t, 10> v;
     std::fill(v.begin(), v.end(), 3);
-    std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, size_t{50});
-    for (size_t i = 0; i < v.size(); ++i)
+    std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, std::size_t{50});
+    for (std::size_t i = 0; i < v.size(); ++i)
         assert(v[i] == 50 + (i + 1) * 4);
     }
 
     {
-    std::array<size_t, 10> v;
+    std::array<std::size_t, 10> v;
     std::iota(v.begin(), v.end(), 0);
-    std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, size_t{30});
-    for (size_t i = 0; i < v.size(); ++i)
+    std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, std::size_t{30});
+    for (std::size_t i = 0; i < v.size(); ++i)
         assert(v[i] == 30 + triangle(i) + i + 1);
     }
 
     {
-    std::array<size_t, 10> v;
+    std::array<std::size_t, 10> v;
     std::iota(v.begin(), v.end(), 1);
-    std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, size_t{40});
-    for (size_t i = 0; i < v.size(); ++i)
+    std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, std::size_t{40});
+    for (std::size_t i = 0; i < v.size(); ++i)
         assert(v[i] == 40 + triangle(i + 1) + i + 1);
     }
 
     {
-    std::array<size_t, 0> v, res;
-    std::transform_inclusive_scan(v.begin(), v.end(), res.begin(), std::plus<>(), add_one{}, size_t{1});
+    std::array<std::size_t, 0> v, res;
+    std::transform_inclusive_scan(v.begin(), v.end(), res.begin(), std::plus<>(), add_one{}, std::size_t{1});
     assert(res.empty());
     }
 
@@ -130,13 +130,13 @@ basic_tests()
     {
     std::array<unsigned char, 10> v;
     std::iota(v.begin(), v.end(), static_cast<unsigned char>(1));
-    std::array<size_t, 10> res;
-    std::transform_inclusive_scan(v.begin(), v.end(), res.begin(), std::multiplies<>(), add_one{}, size_t{1});
+    std::array<std::size_t, 10> res;
+    std::transform_inclusive_scan(v.begin(), v.end(), res.begin(), std::multiplies<>(), add_one{}, std::size_t{1});
 
     assert(res.size() == 10);
-    size_t j = 2;
+    std::size_t j = 2;
     assert(res[0] == 2);
-    for (size_t i = 1; i < res.size(); ++i)
+    for (std::size_t i = 1; i < res.size(); ++i)
     {
         j *= i + 2;
         assert(res[i] == j);

diff  --git a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/eval.pass.cpp b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/eval.pass.cpp
index c24d1a4437931..e11b235b7646d 100644
--- a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/eval.pass.cpp
+++ b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/eval.pass.cpp
@@ -40,7 +40,7 @@ test1()
     G g;
     double b[] = {10, 14, 16, 17};
     double p[] = {25, 62.5, 12.5};
-    const size_t Np = sizeof(p) / sizeof(p[0]);
+    const std::size_t Np = sizeof(p) / sizeof(p[0]);
     D d(b, b+Np+1, p);
     const int N = 1000000;
     std::vector<D::result_type> u;
@@ -60,7 +60,7 @@ test1()
         typedef std::vector<D::result_type>::iterator I;
         I lb = std::lower_bound(u.begin(), u.end(), b[i]);
         I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
-        const size_t Ni = ub - lb;
+        const std::size_t Ni = ub - lb;
         if (prob[i] == 0)
             assert(Ni == 0);
         else
@@ -103,7 +103,7 @@ test2()
     G g;
     double b[] = {10, 14, 16, 17};
     double p[] = {0, 62.5, 12.5};
-    const size_t Np = sizeof(p) / sizeof(p[0]);
+    const std::size_t Np = sizeof(p) / sizeof(p[0]);
     D d(b, b+Np+1, p);
     const int N = 1000000;
     std::vector<D::result_type> u;
@@ -123,7 +123,7 @@ test2()
         typedef std::vector<D::result_type>::iterator I;
         I lb = std::lower_bound(u.begin(), u.end(), b[i]);
         I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
-        const size_t Ni = ub - lb;
+        const std::size_t Ni = ub - lb;
         if (prob[i] == 0)
             assert(Ni == 0);
         else
@@ -166,7 +166,7 @@ test3()
     G g;
     double b[] = {10, 14, 16, 17};
     double p[] = {25, 0, 12.5};
-    const size_t Np = sizeof(p) / sizeof(p[0]);
+    const std::size_t Np = sizeof(p) / sizeof(p[0]);
     D d(b, b+Np+1, p);
     const int N = 1000000;
     std::vector<D::result_type> u;
@@ -186,7 +186,7 @@ test3()
         typedef std::vector<D::result_type>::iterator I;
         I lb = std::lower_bound(u.begin(), u.end(), b[i]);
         I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
-        const size_t Ni = ub - lb;
+        const std::size_t Ni = ub - lb;
         if (prob[i] == 0)
             assert(Ni == 0);
         else
@@ -229,7 +229,7 @@ test4()
     G g;
     double b[] = {10, 14, 16, 17};
     double p[] = {25, 62.5, 0};
-    const size_t Np = sizeof(p) / sizeof(p[0]);
+    const std::size_t Np = sizeof(p) / sizeof(p[0]);
     D d(b, b+Np+1, p);
     const int N = 1000000;
     std::vector<D::result_type> u;
@@ -249,7 +249,7 @@ test4()
         typedef std::vector<D::result_type>::iterator I;
         I lb = std::lower_bound(u.begin(), u.end(), b[i]);
         I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
-        const size_t Ni = ub - lb;
+        const std::size_t Ni = ub - lb;
         if (prob[i] == 0)
             assert(Ni == 0);
         else
@@ -292,7 +292,7 @@ test5()
     G g;
     double b[] = {10, 14, 16, 17};
     double p[] = {25, 0, 0};
-    const size_t Np = sizeof(p) / sizeof(p[0]);
+    const std::size_t Np = sizeof(p) / sizeof(p[0]);
     D d(b, b+Np+1, p);
     const int N = 100000;
     std::vector<D::result_type> u;
@@ -312,7 +312,7 @@ test5()
         typedef std::vector<D::result_type>::iterator I;
         I lb = std::lower_bound(u.begin(), u.end(), b[i]);
         I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
-        const size_t Ni = ub - lb;
+        const std::size_t Ni = ub - lb;
         if (prob[i] == 0)
             assert(Ni == 0);
         else
@@ -355,7 +355,7 @@ test6()
     G g;
     double b[] = {10, 14, 16, 17};
     double p[] = {0, 25, 0};
-    const size_t Np = sizeof(p) / sizeof(p[0]);
+    const std::size_t Np = sizeof(p) / sizeof(p[0]);
     D d(b, b+Np+1, p);
     const int N = 100000;
     std::vector<D::result_type> u;
@@ -375,7 +375,7 @@ test6()
         typedef std::vector<D::result_type>::iterator I;
         I lb = std::lower_bound(u.begin(), u.end(), b[i]);
         I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
-        const size_t Ni = ub - lb;
+        const std::size_t Ni = ub - lb;
         if (prob[i] == 0)
             assert(Ni == 0);
         else
@@ -418,7 +418,7 @@ test7()
     G g;
     double b[] = {10, 14, 16, 17};
     double p[] = {0, 0, 1};
-    const size_t Np = sizeof(p) / sizeof(p[0]);
+    const std::size_t Np = sizeof(p) / sizeof(p[0]);
     D d(b, b+Np+1, p);
     const int N = 100000;
     std::vector<D::result_type> u;
@@ -438,7 +438,7 @@ test7()
         typedef std::vector<D::result_type>::iterator I;
         I lb = std::lower_bound(u.begin(), u.end(), b[i]);
         I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
-        const size_t Ni = ub - lb;
+        const std::size_t Ni = ub - lb;
         if (prob[i] == 0)
             assert(Ni == 0);
         else
@@ -481,7 +481,7 @@ test8()
     G g;
     double b[] = {10, 14, 16};
     double p[] = {75, 25};
-    const size_t Np = sizeof(p) / sizeof(p[0]);
+    const std::size_t Np = sizeof(p) / sizeof(p[0]);
     D d(b, b+Np+1, p);
     const int N = 100000;
     std::vector<D::result_type> u;
@@ -501,7 +501,7 @@ test8()
         typedef std::vector<D::result_type>::iterator I;
         I lb = std::lower_bound(u.begin(), u.end(), b[i]);
         I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
-        const size_t Ni = ub - lb;
+        const std::size_t Ni = ub - lb;
         if (prob[i] == 0)
             assert(Ni == 0);
         else
@@ -544,7 +544,7 @@ test9()
     G g;
     double b[] = {10, 14, 16};
     double p[] = {0, 25};
-    const size_t Np = sizeof(p) / sizeof(p[0]);
+    const std::size_t Np = sizeof(p) / sizeof(p[0]);
     D d(b, b+Np+1, p);
     const int N = 100000;
     std::vector<D::result_type> u;
@@ -564,7 +564,7 @@ test9()
         typedef std::vector<D::result_type>::iterator I;
         I lb = std::lower_bound(u.begin(), u.end(), b[i]);
         I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
-        const size_t Ni = ub - lb;
+        const std::size_t Ni = ub - lb;
         if (prob[i] == 0)
             assert(Ni == 0);
         else
@@ -607,7 +607,7 @@ test10()
     G g;
     double b[] = {10, 14, 16};
     double p[] = {1, 0};
-    const size_t Np = sizeof(p) / sizeof(p[0]);
+    const std::size_t Np = sizeof(p) / sizeof(p[0]);
     D d(b, b+Np+1, p);
     const int N = 100000;
     std::vector<D::result_type> u;
@@ -627,7 +627,7 @@ test10()
         typedef std::vector<D::result_type>::iterator I;
         I lb = std::lower_bound(u.begin(), u.end(), b[i]);
         I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
-        const size_t Ni = ub - lb;
+        const std::size_t Ni = ub - lb;
         if (prob[i] == 0)
             assert(Ni == 0);
         else
@@ -670,7 +670,7 @@ test11()
     G g;
     double b[] = {10, 14};
     double p[] = {1};
-    const size_t Np = sizeof(p) / sizeof(p[0]);
+    const std::size_t Np = sizeof(p) / sizeof(p[0]);
     D d(b, b+Np+1, p);
     const int N = 100000;
     std::vector<D::result_type> u;
@@ -690,7 +690,7 @@ test11()
         typedef std::vector<D::result_type>::iterator I;
         I lb = std::lower_bound(u.begin(), u.end(), b[i]);
         I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
-        const size_t Ni = ub - lb;
+        const std::size_t Ni = ub - lb;
         if (prob[i] == 0)
             assert(Ni == 0);
         else

diff  --git a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/eval_param.pass.cpp b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/eval_param.pass.cpp
index d9f2628a3f03f..d3964ce18e1e1 100644
--- a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/eval_param.pass.cpp
+++ b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/eval_param.pass.cpp
@@ -42,7 +42,7 @@ int main(int, char**)
         G g;
         double b[] = {10, 14, 16, 17};
         double p[] = {25, 62.5, 12.5};
-        const size_t Np = sizeof(p) / sizeof(p[0]);
+        const std::size_t Np = sizeof(p) / sizeof(p[0]);
         D d;
         P pa(b, b+Np+1, p);
         const int N = 1000000;
@@ -63,7 +63,7 @@ int main(int, char**)
             typedef std::vector<D::result_type>::iterator I;
             I lb = std::lower_bound(u.begin(), u.end(), b[i]);
             I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
-            const size_t Ni = ub - lb;
+            const std::size_t Ni = ub - lb;
             if (prob[i] == 0)
                 assert(Ni == 0);
             else

diff  --git a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/get_param.pass.cpp b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/get_param.pass.cpp
index db7c0d6d2e312..e3458fe1da46e 100644
--- a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/get_param.pass.cpp
+++ b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/get_param.pass.cpp
@@ -25,7 +25,7 @@ int main(int, char**)
         typedef D::param_type P;
         double b[] = {10, 14, 16, 17};
         double p[] = {25, 62.5, 12.5};
-        const size_t Np = sizeof(p) / sizeof(p[0]);
+        const std::size_t Np = sizeof(p) / sizeof(p[0]);
         P pa(b, b+Np+1, p);
         D d(pa);
         assert(d.param() == pa);

diff  --git a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/io.pass.cpp b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/io.pass.cpp
index 72a66c7be7763..f173d6bd809ab 100644
--- a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/io.pass.cpp
+++ b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/io.pass.cpp
@@ -35,7 +35,7 @@ int main(int, char**)
         typedef std::piecewise_constant_distribution<> D;
         double b[] = {10, 14, 16, 17};
         double p[] = {25, 62.5, 12.5};
-        const size_t Np = sizeof(p) / sizeof(p[0]);
+        const std::size_t Np = sizeof(p) / sizeof(p[0]);
         D d1(b, b+Np+1, p);
         std::ostringstream os;
         os << d1;

diff  --git a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/max.pass.cpp b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/max.pass.cpp
index fe0c23f61ecc9..f0bca2ae10acf 100644
--- a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/max.pass.cpp
+++ b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/max.pass.cpp
@@ -24,7 +24,7 @@ int main(int, char**)
         typedef std::piecewise_constant_distribution<> D;
         double b[] = {10, 14, 16, 17};
         double p[] = {25, 62.5, 12.5};
-        const size_t Np = sizeof(p) / sizeof(p[0]);
+        const std::size_t Np = sizeof(p) / sizeof(p[0]);
         D d(b, b+Np+1, p);
         assert(d.max() == 17);
     }

diff  --git a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/min.pass.cpp b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/min.pass.cpp
index 533f3e27017eb..060c4eeaac8ed 100644
--- a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/min.pass.cpp
+++ b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/min.pass.cpp
@@ -24,7 +24,7 @@ int main(int, char**)
         typedef std::piecewise_constant_distribution<> D;
         double b[] = {10, 14, 16, 17};
         double p[] = {25, 62.5, 12.5};
-        const size_t Np = sizeof(p) / sizeof(p[0]);
+        const std::size_t Np = sizeof(p) / sizeof(p[0]);
         D d(b, b+Np+1, p);
         assert(d.min() == 10);
     }

diff  --git a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/param_assign.pass.cpp b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/param_assign.pass.cpp
index a97708dcfd6b1..a7074a8a23ef9 100644
--- a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/param_assign.pass.cpp
+++ b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/param_assign.pass.cpp
@@ -26,7 +26,7 @@ int main(int, char**)
         typedef D::param_type P;
         double b[] = {10, 14, 16, 17};
         double p[] = {25, 62.5, 12.5};
-        const size_t Np = sizeof(p) / sizeof(p[0]);
+        const std::size_t Np = sizeof(p) / sizeof(p[0]);
         P p0(b, b+Np+1, p);
         P p1;
         p1 = p0;

diff  --git a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/param_copy.pass.cpp b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/param_copy.pass.cpp
index 80b442a458a91..1d444163e0432 100644
--- a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/param_copy.pass.cpp
+++ b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/param_copy.pass.cpp
@@ -26,7 +26,7 @@ int main(int, char**)
         typedef D::param_type P;
         double b[] = {10, 14, 16, 17};
         double p[] = {25, 62.5, 12.5};
-        const size_t Np = sizeof(p) / sizeof(p[0]);
+        const std::size_t Np = sizeof(p) / sizeof(p[0]);
         P p0(b, b+Np+1, p);
         P p1 = p0;
         assert(p1 == p0);

diff  --git a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp
index ea8924effe395..e551c8c2bb38d 100644
--- a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp
+++ b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp
@@ -47,11 +47,11 @@ test1()
     G g;
     double b[] = {10, 14, 16, 17};
     double p[] = {0, 1, 1, 0};
-    const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
+    const std::size_t Np = sizeof(p) / sizeof(p[0]) - 1;
     D d(b, b+Np+1, p);
     const int N = 1000000;
     std::vector<D::result_type> u;
-    for (size_t i = 0; i < N; ++i)
+    for (std::size_t i = 0; i < N; ++i)
     {
         D::result_type v = d(g);
         assert(d.min() <= v && v < d.max());
@@ -65,16 +65,16 @@ test1()
     double c = std::numeric_limits<double>::quiet_NaN();
     std::vector<double> areas(Np);
     double S = 0;
-    for (size_t i = 0; i < areas.size(); ++i)
+    for (std::size_t i = 0; i < areas.size(); ++i)
     {
         areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
         S += areas[i];
     }
-    for (size_t i = 0; i < areas.size(); ++i)
+    for (std::size_t i = 0; i < areas.size(); ++i)
         areas[i] /= S;
-    for (size_t i = 0; i < Np+1; ++i)
+    for (std::size_t i = 0; i < Np+1; ++i)
         p[i] /= S;
-    for (size_t i = 0; i < N; ++i)
+    for (std::size_t i = 0; i < N; ++i)
     {
         int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
         if (k != kp)
@@ -99,11 +99,11 @@ test2()
     G g;
     double b[] = {10, 14, 16, 17};
     double p[] = {0, 0, 1, 0};
-    const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
+    const std::size_t Np = sizeof(p) / sizeof(p[0]) - 1;
     D d(b, b+Np+1, p);
     const int N = 1000000;
     std::vector<D::result_type> u;
-    for (size_t i = 0; i < N; ++i)
+    for (std::size_t i = 0; i < N; ++i)
     {
         D::result_type v = d(g);
         assert(d.min() <= v && v < d.max());
@@ -117,16 +117,16 @@ test2()
     double c = std::numeric_limits<double>::quiet_NaN();
     std::vector<double> areas(Np);
     double S = 0;
-    for (size_t i = 0; i < areas.size(); ++i)
+    for (std::size_t i = 0; i < areas.size(); ++i)
     {
         areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
         S += areas[i];
     }
-    for (size_t i = 0; i < areas.size(); ++i)
+    for (std::size_t i = 0; i < areas.size(); ++i)
         areas[i] /= S;
-    for (size_t i = 0; i < Np+1; ++i)
+    for (std::size_t i = 0; i < Np+1; ++i)
         p[i] /= S;
-    for (size_t i = 0; i < N; ++i)
+    for (std::size_t i = 0; i < N; ++i)
     {
         int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
         if (k != kp)
@@ -151,11 +151,11 @@ test3()
     G g;
     double b[] = {10, 14, 16, 17};
     double p[] = {1, 0, 0, 0};
-    const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
+    const std::size_t Np = sizeof(p) / sizeof(p[0]) - 1;
     D d(b, b+Np+1, p);
-    const size_t N = 1000000;
+    const std::size_t N = 1000000;
     std::vector<D::result_type> u;
-    for (size_t i = 0; i < N; ++i)
+    for (std::size_t i = 0; i < N; ++i)
     {
         D::result_type v = d(g);
         assert(d.min() <= v && v < d.max());
@@ -169,16 +169,16 @@ test3()
     double c = std::numeric_limits<double>::quiet_NaN();
     std::vector<double> areas(Np);
     double S = 0;
-    for (size_t i = 0; i < areas.size(); ++i)
+    for (std::size_t i = 0; i < areas.size(); ++i)
     {
         areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
         S += areas[i];
     }
-    for (size_t i = 0; i < areas.size(); ++i)
+    for (std::size_t i = 0; i < areas.size(); ++i)
         areas[i] /= S;
-    for (size_t i = 0; i < Np+1; ++i)
+    for (std::size_t i = 0; i < Np+1; ++i)
         p[i] /= S;
-    for (size_t i = 0; i < N; ++i)
+    for (std::size_t i = 0; i < N; ++i)
     {
         int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
         if (k != kp)
@@ -203,11 +203,11 @@ test4()
     G g;
     double b[] = {10, 14, 16};
     double p[] = {0, 1, 0};
-    const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
+    const std::size_t Np = sizeof(p) / sizeof(p[0]) - 1;
     D d(b, b+Np+1, p);
     const int N = 1000000;
     std::vector<D::result_type> u;
-    for (size_t i = 0; i < N; ++i)
+    for (std::size_t i = 0; i < N; ++i)
     {
         D::result_type v = d(g);
         assert(d.min() <= v && v < d.max());
@@ -221,16 +221,16 @@ test4()
     double c = std::numeric_limits<double>::quiet_NaN();
     std::vector<double> areas(Np);
     double S = 0;
-    for (size_t i = 0; i < areas.size(); ++i)
+    for (std::size_t i = 0; i < areas.size(); ++i)
     {
         areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
         S += areas[i];
     }
-    for (size_t i = 0; i < areas.size(); ++i)
+    for (std::size_t i = 0; i < areas.size(); ++i)
         areas[i] /= S;
-    for (size_t i = 0; i < Np+1; ++i)
+    for (std::size_t i = 0; i < Np+1; ++i)
         p[i] /= S;
-    for (size_t i = 0; i < N; ++i)
+    for (std::size_t i = 0; i < N; ++i)
     {
         int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
         if (k != kp)
@@ -256,11 +256,11 @@ test5()
     G g;
     double b[] = {10, 14};
     double p[] = {1, 1};
-    const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
+    const std::size_t Np = sizeof(p) / sizeof(p[0]) - 1;
     D d(b, b+Np+1, p);
     const int N = 1000000;
     std::vector<D::result_type> u;
-    for (size_t i = 0; i < N; ++i)
+    for (std::size_t i = 0; i < N; ++i)
     {
         D::result_type v = d(g);
         assert(d.min() <= v && v < d.max());
@@ -274,17 +274,17 @@ test5()
     double c = std::numeric_limits<double>::quiet_NaN();
     std::vector<double> areas(Np);
     double S = 0;
-    for (size_t i = 0; i < areas.size(); ++i)
+    for (std::size_t i = 0; i < areas.size(); ++i)
     {
         assert(i < Np);
         areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
         S += areas[i];
     }
-    for (size_t i = 0; i < areas.size(); ++i)
+    for (std::size_t i = 0; i < areas.size(); ++i)
         areas[i] /= S;
-    for (size_t i = 0; i < Np+1; ++i)
+    for (std::size_t i = 0; i < Np+1; ++i)
         p[i] /= S;
-    for (size_t i = 0; i < N; ++i)
+    for (std::size_t i = 0; i < N; ++i)
     {
         int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
         if (k != kp)
@@ -310,11 +310,11 @@ test6()
     G g;
     double b[] = {10, 14, 16, 17};
     double p[] = {25, 62.5, 12.5, 0};
-    const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
+    const std::size_t Np = sizeof(p) / sizeof(p[0]) - 1;
     D d(b, b+Np+1, p);
     const int N = 1000000;
     std::vector<D::result_type> u;
-    for (size_t i = 0; i < N; ++i)
+    for (std::size_t i = 0; i < N; ++i)
     {
         D::result_type v = d(g);
         assert(d.min() <= v && v < d.max());
@@ -328,16 +328,16 @@ test6()
     double c = std::numeric_limits<double>::quiet_NaN();
     std::vector<double> areas(Np);
     double S = 0;
-    for (size_t i = 0; i < areas.size(); ++i)
+    for (std::size_t i = 0; i < areas.size(); ++i)
     {
         areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
         S += areas[i];
     }
-    for (size_t i = 0; i < areas.size(); ++i)
+    for (std::size_t i = 0; i < areas.size(); ++i)
         areas[i] /= S;
-    for (size_t i = 0; i < Np+1; ++i)
+    for (std::size_t i = 0; i < Np+1; ++i)
         p[i] /= S;
-    for (size_t i = 0; i < N; ++i)
+    for (std::size_t i = 0; i < N; ++i)
     {
         int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
         if (k != kp)

diff  --git a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/eval_param.pass.cpp b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/eval_param.pass.cpp
index 9c9365fa772ab..605b11942a0ed 100644
--- a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/eval_param.pass.cpp
+++ b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/eval_param.pass.cpp
@@ -48,12 +48,12 @@ int main(int, char**)
         G g;
         double b[] = {10, 14, 16, 17};
         double p[] = {25, 62.5, 12.5, 0};
-        const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
+        const std::size_t Np = sizeof(p) / sizeof(p[0]) - 1;
         D d;
         P pa(b, b+Np+1, p);
-        const size_t N = 1000000;
+        const std::size_t N = 1000000;
         std::vector<D::result_type> u;
-        for (size_t i = 0; i < N; ++i)
+        for (std::size_t i = 0; i < N; ++i)
         {
             D::result_type v = d(g, pa);
             assert(10 <= v && v < 17);
@@ -67,16 +67,16 @@ int main(int, char**)
         double c = std::numeric_limits<double>::quiet_NaN();
         std::vector<double> areas(Np);
         double S = 0;
-        for (size_t i = 0; i < areas.size(); ++i)
+        for (std::size_t i = 0; i < areas.size(); ++i)
         {
             areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
             S += areas[i];
         }
-        for (size_t i = 0; i < areas.size(); ++i)
+        for (std::size_t i = 0; i < areas.size(); ++i)
             areas[i] /= S;
-        for (size_t i = 0; i < Np+1; ++i)
+        for (std::size_t i = 0; i < Np+1; ++i)
             p[i] /= S;
-        for (size_t i = 0; i < N; ++i)
+        for (std::size_t i = 0; i < N; ++i)
         {
             int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
             if (k != kp)

diff  --git a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/get_param.pass.cpp b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/get_param.pass.cpp
index b9450c0952e83..5c3600885cb70 100644
--- a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/get_param.pass.cpp
+++ b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/get_param.pass.cpp
@@ -25,7 +25,7 @@ int main(int, char**)
         typedef D::param_type P;
         double b[] = {10, 14, 16, 17};
         double p[] = {25, 62.5, 12.5, 10};
-        const size_t Np = sizeof(p) / sizeof(p[0]);
+        const std::size_t Np = sizeof(p) / sizeof(p[0]);
         P pa(b, b+Np, p);
         D d(pa);
         assert(d.param() == pa);

diff  --git a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/io.pass.cpp b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/io.pass.cpp
index e3983b9c2d0c6..8a0a8ff5a9ec0 100644
--- a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/io.pass.cpp
+++ b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/io.pass.cpp
@@ -35,7 +35,7 @@ int main(int, char**)
         typedef std::piecewise_linear_distribution<> D;
         double b[] = {10, 14, 16, 17};
         double p[] = {25, 62.5, 12.5, 25};
-        const size_t Np = sizeof(p) / sizeof(p[0]);
+        const std::size_t Np = sizeof(p) / sizeof(p[0]);
         D d1(b, b+Np, p);
         std::ostringstream os;
         os << d1;

diff  --git a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/max.pass.cpp b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/max.pass.cpp
index e0c68578bc475..b37ab293b4d40 100644
--- a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/max.pass.cpp
+++ b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/max.pass.cpp
@@ -24,7 +24,7 @@ int main(int, char**)
         typedef std::piecewise_linear_distribution<> D;
         double b[] = {10, 14, 16, 17};
         double p[] = {25, 62.5, 12.5, 5};
-        const size_t Np = sizeof(p) / sizeof(p[0]);
+        const std::size_t Np = sizeof(p) / sizeof(p[0]);
         D d(b, b+Np, p);
         assert(d.max() == 17);
     }

diff  --git a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/min.pass.cpp b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/min.pass.cpp
index a0ec3221a3342..51b555e21a833 100644
--- a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/min.pass.cpp
+++ b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/min.pass.cpp
@@ -24,7 +24,7 @@ int main(int, char**)
         typedef std::piecewise_linear_distribution<> D;
         double b[] = {10, 14, 16, 17};
         double p[] = {25, 62.5, 12.5, 0};
-        const size_t Np = sizeof(p) / sizeof(p[0]);
+        const std::size_t Np = sizeof(p) / sizeof(p[0]);
         D d(b, b+Np, p);
         assert(d.min() == 10);
     }

diff  --git a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/param_assign.pass.cpp b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/param_assign.pass.cpp
index 47b5c28b7e733..ff9e317218803 100644
--- a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/param_assign.pass.cpp
+++ b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/param_assign.pass.cpp
@@ -26,7 +26,7 @@ int main(int, char**)
         typedef D::param_type P;
         double b[] = {10, 14, 16, 17};
         double p[] = {25, 62.5, 12.5, 2};
-        const size_t Np = sizeof(p) / sizeof(p[0]);
+        const std::size_t Np = sizeof(p) / sizeof(p[0]);
         P p0(b, b+Np, p);
         P p1;
         p1 = p0;

diff  --git a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/param_copy.pass.cpp b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/param_copy.pass.cpp
index b88d9c252f7ea..15a8466fdf8ca 100644
--- a/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/param_copy.pass.cpp
+++ b/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.plinear/param_copy.pass.cpp
@@ -26,7 +26,7 @@ int main(int, char**)
         typedef D::param_type P;
         double b[] = {10, 14, 16, 17};
         double p[] = {25, 62.5, 12.5, 5};
-        const size_t Np = sizeof(p) / sizeof(p[0]);
+        const std::size_t Np = sizeof(p) / sizeof(p[0]);
         P p0(b, b+Np, p);
         P p1 = p0;
         assert(p1 == p0);

diff  --git a/libcxx/test/std/ranges/range.access/empty.pass.cpp b/libcxx/test/std/ranges/range.access/empty.pass.cpp
index 4ff1f3b941f44..990b75bf6452d 100644
--- a/libcxx/test/std/ranges/range.access/empty.pass.cpp
+++ b/libcxx/test/std/ranges/range.access/empty.pass.cpp
@@ -87,13 +87,13 @@ constexpr bool testEmptyMember() {
 }
 
 struct SizeMember {
-  size_t size_;
-  constexpr size_t size() const { return size_; }
+  std::size_t size_;
+  constexpr std::size_t size() const { return size_; }
 };
 
 struct SizeFunction {
-  size_t size_;
-  friend constexpr size_t size(SizeFunction sf) { return sf.size_; }
+  std::size_t size_;
+  friend constexpr std::size_t size(SizeFunction sf) { return sf.size_; }
 };
 
 struct BeginEndSizedSentinel {
@@ -131,7 +131,7 @@ static_assert(!std::ranges::sized_range<BeginEndNotSizedSentinel>);
 struct DisabledSizeRangeWithBeginEnd {
   constexpr int *begin() const { return nullptr; }
   constexpr auto end() const { return sentinel_wrapper<int*>(nullptr); }
-  size_t size() const;
+  std::size_t size() const;
 };
 template<>
 inline constexpr bool std::ranges::disable_sized_range<DisabledSizeRangeWithBeginEnd> = true;

diff  --git a/libcxx/test/std/ranges/range.access/size.pass.cpp b/libcxx/test/std/ranges/range.access/size.pass.cpp
index 05681733f37d9..fd7d0a8b99752 100644
--- a/libcxx/test/std/ranges/range.access/size.pass.cpp
+++ b/libcxx/test/std/ranges/range.access/size.pass.cpp
@@ -35,23 +35,23 @@ static_assert(std::ranges::size(std::as_const(array_of_incomplete)) == 42);
 static_assert(std::ranges::size(static_cast<const Incomplete(&&)[42]>(array_of_incomplete)) == 42);
 
 struct SizeMember {
-  constexpr size_t size() { return 42; }
+  constexpr std::size_t size() { return 42; }
 };
 
 struct StaticSizeMember {
-  constexpr static size_t size() { return 42; }
+  constexpr static std::size_t size() { return 42; }
 };
 
 static_assert(!std::is_invocable_v<RangeSizeT, const SizeMember>);
 
 struct SizeFunction {
-  friend constexpr size_t size(SizeFunction) { return 42; }
+  friend constexpr std::size_t size(SizeFunction) { return 42; }
 };
 
 // Make sure the size member is preferred.
 struct SizeMemberAndFunction {
-  constexpr size_t size() { return 42; }
-  friend constexpr size_t size(SizeMemberAndFunction) { return 0; }
+  constexpr std::size_t size() { return 42; }
+  friend constexpr std::size_t size(SizeMemberAndFunction) { return 0; }
 };
 
 bool constexpr testArrayType() {
@@ -61,19 +61,19 @@ bool constexpr testArrayType() {
   SizeFunction d[4];
 
   assert(std::ranges::size(a) == 4);
-  ASSERT_SAME_TYPE(decltype(std::ranges::size(a)), size_t);
+  ASSERT_SAME_TYPE(decltype(std::ranges::size(a)), std::size_t);
   assert(std::ranges::size(b) == 1);
-  ASSERT_SAME_TYPE(decltype(std::ranges::size(b)), size_t);
+  ASSERT_SAME_TYPE(decltype(std::ranges::size(b)), std::size_t);
   assert(std::ranges::size(c) == 4);
-  ASSERT_SAME_TYPE(decltype(std::ranges::size(c)), size_t);
+  ASSERT_SAME_TYPE(decltype(std::ranges::size(c)), std::size_t);
   assert(std::ranges::size(d) == 4);
-  ASSERT_SAME_TYPE(decltype(std::ranges::size(d)), size_t);
+  ASSERT_SAME_TYPE(decltype(std::ranges::size(d)), std::size_t);
 
   return true;
 }
 
 struct SizeMemberConst {
-  constexpr size_t size() const { return 42; }
+  constexpr std::size_t size() const { return 42; }
 };
 
 struct SizeMemberSigned {
@@ -82,7 +82,7 @@ struct SizeMemberSigned {
 
 bool constexpr testHasSizeMember() {
   assert(std::ranges::size(SizeMember()) == 42);
-  ASSERT_SAME_TYPE(decltype(std::ranges::size(SizeMember())), size_t);
+  ASSERT_SAME_TYPE(decltype(std::ranges::size(SizeMember())), std::size_t);
 
   const SizeMemberConst sizeMemberConst;
   assert(std::ranges::size(sizeMemberConst) == 42);
@@ -93,7 +93,7 @@ bool constexpr testHasSizeMember() {
   ASSERT_SAME_TYPE(decltype(std::ranges::size(SizeMemberSigned())), long);
 
   assert(std::ranges::size(StaticSizeMember()) == 42);
-  ASSERT_SAME_TYPE(decltype(std::ranges::size(StaticSizeMember())), size_t);
+  ASSERT_SAME_TYPE(decltype(std::ranges::size(StaticSizeMember())), std::size_t);
 
   return true;
 }
@@ -103,25 +103,25 @@ struct MoveOnlySizeFunction {
   MoveOnlySizeFunction(MoveOnlySizeFunction &&) = default;
   MoveOnlySizeFunction(MoveOnlySizeFunction const&) = delete;
 
-  friend constexpr size_t size(MoveOnlySizeFunction) { return 42; }
+  friend constexpr std::size_t size(MoveOnlySizeFunction) { return 42; }
 };
 
 enum EnumSizeFunction {
   a, b
 };
 
-constexpr size_t size(EnumSizeFunction) { return 42; }
+constexpr std::size_t size(EnumSizeFunction) { return 42; }
 
 struct SizeFunctionConst {
-  friend constexpr size_t size(const SizeFunctionConst) { return 42; }
+  friend constexpr std::size_t size(const SizeFunctionConst) { return 42; }
 };
 
 struct SizeFunctionRef {
-  friend constexpr size_t size(SizeFunctionRef&) { return 42; }
+  friend constexpr std::size_t size(SizeFunctionRef&) { return 42; }
 };
 
 struct SizeFunctionConstRef {
-  friend constexpr size_t size(SizeFunctionConstRef const&) { return 42; }
+  friend constexpr std::size_t size(SizeFunctionConstRef const&) { return 42; }
 };
 
 struct SizeFunctionSigned {
@@ -130,7 +130,7 @@ struct SizeFunctionSigned {
 
 bool constexpr testHasSizeFunction() {
   assert(std::ranges::size(SizeFunction()) == 42);
-  ASSERT_SAME_TYPE(decltype(std::ranges::size(SizeFunction())), size_t);
+  ASSERT_SAME_TYPE(decltype(std::ranges::size(SizeFunction())), std::size_t);
   static_assert(!std::is_invocable_v<RangeSizeT, MoveOnlySizeFunction>);
   assert(std::ranges::size(EnumSizeFunction()) == 42);
   assert(std::ranges::size(SizeFunctionConst()) == 42);
@@ -159,7 +159,7 @@ struct InvalidReturnTypeFunction {
 };
 
 struct Convertible {
-  operator size_t();
+  operator std::size_t();
 };
 
 struct ConvertibleReturnTypeMember {
@@ -188,14 +188,14 @@ static_assert(!std::is_invocable_v<RangeSizeT, BoolReturnTypeMember const&>);
 static_assert(!std::is_invocable_v<RangeSizeT, BoolReturnTypeFunction const&>);
 
 struct SizeMemberDisabled {
-  size_t size() { return 42; }
+  std::size_t size() { return 42; }
 };
 
 template <>
 inline constexpr bool std::ranges::disable_sized_range<SizeMemberDisabled> = true;
 
 struct ImproperlyDisabledMember {
-  size_t size() const { return 42; }
+  std::size_t size() const { return 42; }
 };
 
 // Intentionally disabling "const ConstSizeMemberDisabled". This doesn't disable anything
@@ -204,14 +204,14 @@ template <>
 inline constexpr bool std::ranges::disable_sized_range<const ImproperlyDisabledMember> = true;
 
 struct SizeFunctionDisabled {
-  friend size_t size(SizeFunctionDisabled) { return 42; }
+  friend std::size_t size(SizeFunctionDisabled) { return 42; }
 };
 
 template <>
 inline constexpr bool std::ranges::disable_sized_range<SizeFunctionDisabled> = true;
 
 struct ImproperlyDisabledFunction {
-  friend size_t size(ImproperlyDisabledFunction const&) { return 42; }
+  friend std::size_t size(ImproperlyDisabledFunction const&) { return 42; }
 };
 
 template <>
@@ -224,7 +224,7 @@ static_assert( std::is_invocable_v<RangeSizeT, const ImproperlyDisabledFunction&
 
 // No begin end.
 struct HasMinusOperator {
-  friend constexpr size_t operator-(HasMinusOperator, HasMinusOperator) { return 2; }
+  friend constexpr std::size_t operator-(HasMinusOperator, HasMinusOperator) { return 2; }
 };
 static_assert(!std::is_invocable_v<RangeSizeT, HasMinusOperator>);
 
@@ -277,7 +277,7 @@ struct DisabledSizeRangeWithBeginEnd {
   int buff[8];
   constexpr int* begin() { return buff; }
   constexpr int* end() { return buff + 8; }
-  constexpr size_t size() { return 1; }
+  constexpr std::size_t size() { return 1; }
 };
 
 template <>
@@ -287,14 +287,14 @@ struct SizeBeginAndEndMembers {
   int buff[8];
   constexpr int* begin() { return buff; }
   constexpr int* end() { return buff + 8; }
-  constexpr size_t size() { return 1; }
+  constexpr std::size_t size() { return 1; }
 };
 
 constexpr bool testRanges() {
   HasMinusBeginEnd a;
   assert(std::ranges::size(a) == 2);
   // Ensure that this is converted to an *unsigned* type.
-  ASSERT_SAME_TYPE(decltype(std::ranges::size(a)), size_t);
+  ASSERT_SAME_TYPE(decltype(std::ranges::size(a)), std::size_t);
 
   IntPtrBeginAndEnd b;
   assert(std::ranges::size(b) == 8);
@@ -304,7 +304,7 @@ constexpr bool testRanges() {
 
   RandomAccessRange d;
   assert(std::ranges::size(d) == 2);
-  ASSERT_SAME_TYPE(decltype(std::ranges::size(d)), size_t);
+  ASSERT_SAME_TYPE(decltype(std::ranges::size(d)), std::size_t);
 
   SizeBeginAndEndMembers e;
   assert(std::ranges::size(e) == 1);

diff  --git a/libcxx/test/std/ranges/range.access/ssize.pass.cpp b/libcxx/test/std/ranges/range.access/ssize.pass.cpp
index be35fe276e9b5..a15dc344512a1 100644
--- a/libcxx/test/std/ranges/range.access/ssize.pass.cpp
+++ b/libcxx/test/std/ranges/range.access/ssize.pass.cpp
@@ -24,12 +24,12 @@ static_assert( std::is_invocable_v<RangeSSizeT, int (&&)[1]>);
 static_assert( std::is_invocable_v<RangeSSizeT, int (&)[1]>);
 
 struct SizeMember {
-  constexpr size_t size() { return 42; }
+  constexpr std::size_t size() { return 42; }
 };
 static_assert(!std::is_invocable_v<decltype(std::ranges::ssize), const SizeMember&>);
 
 struct SizeFunction {
-  friend constexpr size_t size(SizeFunction) { return 42; }
+  friend constexpr std::size_t size(SizeFunction) { return 42; }
 };
 
 struct SizeFunctionSigned {
@@ -47,7 +47,7 @@ struct ShortUnsignedReturnType {
 };
 
 // size_t changes depending on the platform.
-using SignedSizeT = std::make_signed_t<size_t>;
+using SignedSizeT = std::make_signed_t<std::size_t>;
 
 constexpr bool test() {
   int a[4];

diff  --git a/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/size.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/size.pass.cpp
index f330b41898b70..3de1a93bc2e61 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/size.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/size.pass.cpp
@@ -20,7 +20,7 @@ struct ConstSizedView : std::ranges::view_base {
   int* begin() const;
   int* end() const;
 
-  constexpr size_t size() const {
+  constexpr std::size_t size() const {
     *size_called = true;
     return 3;
   }
@@ -56,7 +56,7 @@ constexpr bool test() {
   {
     bool size_called = false;
     std::ranges::as_rvalue_view view(ConstSizedView{{}, &size_called});
-    std::same_as<size_t> auto size = view.size();
+    std::same_as<std::size_t> auto size = view.size();
     assert(size == 3);
     assert(size_called);
   }

diff  --git a/libcxx/test/std/ranges/range.adaptors/range.counted/counted.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.counted/counted.pass.cpp
index 71014f1f10bf9..e55121f95e7c2 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.counted/counted.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.counted/counted.pass.cpp
@@ -46,7 +46,7 @@ constexpr bool test() {
   {
     static_assert(std::addressof(std::views::counted) == std::addressof(std::ranges::views::counted));
 
-    static_assert( CountedInvocable<int*, size_t>);
+    static_assert( CountedInvocable<int*, std::size_t>);
     static_assert(!CountedInvocable<int*, LvalueConvertible>);
     static_assert( CountedInvocable<int*, LvalueConvertible&>);
     static_assert( CountedInvocable<int*, RvalueConvertible>);
@@ -54,7 +54,7 @@ constexpr bool test() {
     static_assert(!CountedInvocable<int*, OnlyExplicitlyConvertible>);
     static_assert(!CountedInvocable<int*, int*>);
     static_assert(!CountedInvocable<int*>);
-    static_assert(!CountedInvocable<size_t>);
+    static_assert(!CountedInvocable<std::size_t>);
     static_assert(!CountedInvocable<>);
   }
 

diff  --git a/libcxx/test/std/ranges/range.adaptors/range.drop/adaptor.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.drop/adaptor.pass.cpp
index 6dd90c530b7b5..542f2cda3ee84 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.drop/adaptor.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.drop/adaptor.pass.cpp
@@ -47,7 +47,7 @@ struct SizedViewWithUnsizedSentinel : std::ranges::view_base {
 
   constexpr auto begin() const { return iterator(begin_); }
   constexpr auto end() const { return sentinel(iterator(end_)); }
-  constexpr size_t size() const { return end_ - begin_; }
+  constexpr std::size_t size() const { return end_ - begin_; }
 };
 static_assert(std::ranges::random_access_range<SizedViewWithUnsizedSentinel>);
 static_assert(std::ranges::sized_range<SizedViewWithUnsizedSentinel>);

diff  --git a/libcxx/test/std/ranges/range.adaptors/range.drop/begin.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.drop/begin.pass.cpp
index 5d08c7027ea85..cff088453d226 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.drop/begin.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.drop/begin.pass.cpp
@@ -37,7 +37,7 @@ struct MaybeSimpleView : std::ranges::view_base {
     return nullptr;
   }
   constexpr int* end() const { return nullptr; }
-  constexpr size_t size() const { return 0; }
+  constexpr std::size_t size() const { return 0; }
 };
 
 using SimpleView = MaybeSimpleView<true>;

diff  --git a/libcxx/test/std/ranges/range.adaptors/range.elements/iterator/ctor.default.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.elements/iterator/ctor.default.pass.cpp
index 62aa9b2a1a1f7..11da4843270bf 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.elements/iterator/ctor.default.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.elements/iterator/ctor.default.pass.cpp
@@ -29,7 +29,7 @@ struct IterNoDefaultCtrView : std::ranges::view_base {
   sentinel_wrapper<cpp20_input_iterator<std::tuple<int>*>> end() const;
 };
 
-template <class View, size_t N>
+template <class View, std::size_t N>
 using ElementsIter = std::ranges::iterator_t<std::ranges::elements_view<View, N>>;
 
 static_assert(!std::default_initializable<ElementsIter<IterNoDefaultCtrView, 0>>);

diff  --git a/libcxx/test/std/ranges/range.adaptors/range.elements/iterator/member_types.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.elements/iterator/member_types.compile.pass.cpp
index 67ec179b50b6b..9a76c2fcb70c2 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.elements/iterator/member_types.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.elements/iterator/member_types.compile.pass.cpp
@@ -20,7 +20,7 @@
 template <class Iter>
 using Range = std::ranges::subrange<Iter, sentinel_wrapper<Iter>>;
 
-template <class Range, size_t N = 0>
+template <class Range, std::size_t N = 0>
 using ElementsIter = std::ranges::iterator_t<std::ranges::elements_view<Range, N>>;
 
 // using iterator_concept = see below;

diff  --git a/libcxx/test/std/ranges/range.adaptors/range.elements/range.concept.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.elements/range.concept.compile.pass.cpp
index 021f0283b4336..7de72ecc0a90c 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.elements/range.concept.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.elements/range.concept.compile.pass.cpp
@@ -35,7 +35,7 @@
 template <class It>
 using Range = std::ranges::subrange<It, sentinel_wrapper<It>>;
 
-template <class V, size_t N>
+template <class V, std::size_t N>
 concept HasElementsView = requires { typename std::ranges::elements_view<V, N>; };
 
 static_assert(HasElementsView<Range<std::ranges::subrange<int*>*>, 0>);

diff  --git a/libcxx/test/std/ranges/range.adaptors/range.lazy.split/constraints.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.lazy.split/constraints.compile.pass.cpp
index bf9dd997d184c..122abe6315c11 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.lazy.split/constraints.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.lazy.split/constraints.compile.pass.cpp
@@ -169,7 +169,7 @@ namespace test8 {
   struct AlmostTinyRange : std::ranges::view_base {
     int* begin() const;
     int* end() const;
-    static size_t size() { return 1; }
+    static std::size_t size() { return 1; }
   };
 
   using View = InputView;
@@ -192,7 +192,7 @@ namespace test9 {
   struct AlmostTinyRange : std::ranges::view_base {
     int* begin() const;
     int* end() const;
-    constexpr static size_t size() { return 2; }
+    constexpr static std::size_t size() { return 2; }
   };
 
   using View = InputView;

diff  --git a/libcxx/test/std/ranges/range.adaptors/range.lazy.split/general.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.lazy.split/general.pass.cpp
index 421453245ef8d..f4e87bb47399e 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.lazy.split/general.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.lazy.split/general.pass.cpp
@@ -75,13 +75,13 @@ constexpr bool is_equal(View& view, const Expected& expected) {
   return actual_it == view.end() && expected_it == expected.end();
 }
 
-template <class T, class Separator, class U, size_t M>
+template <class T, class Separator, class U, std::size_t M>
 constexpr bool test_function_call(T&& input, Separator&& separator, std::array<U, M> expected) {
   std::ranges::lazy_split_view v(input, separator);
   return is_equal(v, expected);
 }
 
-template <class T, class Separator, class U, size_t M>
+template <class T, class Separator, class U, std::size_t M>
 constexpr bool test_with_piping(T&& input, Separator&& separator, std::array<U, M> expected) {
   auto expected_it = expected.begin();
   for (auto e : input | std::ranges::views::lazy_split(separator)) {
@@ -166,7 +166,7 @@ constexpr std::string_view sv(T&& str) {
   return std::string_view(str);
 };
 
-template <class T, class Separator, class U, size_t M>
+template <class T, class Separator, class U, std::size_t M>
 constexpr void test_one(T&& input, Separator&& separator, std::array<U, M> expected) {
   assert(test_function_call(input, separator, expected));
   assert(test_with_piping(input, separator, expected));

diff  --git a/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/increment.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/increment.pass.cpp
index e4d9ebab26b14..45257f228008e 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/increment.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/increment.pass.cpp
@@ -22,7 +22,7 @@
 struct EmptyView : std::ranges::view_base {
   constexpr int* begin() const { return nullptr; }
   constexpr int* end() const { return nullptr; }
-  constexpr static size_t size() { return 0; }
+  constexpr static std::size_t size() { return 0; }
 };
 static_assert(std::ranges::forward_range<EmptyView>);
 static_assert(std::ranges::view<EmptyView>);

diff  --git a/libcxx/test/std/ranges/range.adaptors/range.lazy.split/types.h b/libcxx/test/std/ranges/range.adaptors/range.lazy.split/types.h
index 2eedc4c91d414..f2878e823202e 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.lazy.split/types.h
+++ b/libcxx/test/std/ranges/range.adaptors/range.lazy.split/types.h
@@ -10,6 +10,7 @@
 #define TEST_STD_RANGES_RANGE_ADAPTORS_RANGE_LAZY_SPLIT_TYPES_H
 
 #include <concepts>
+#include <cstddef>
 #include <ranges>
 #include <string>
 #include <string_view>
@@ -174,7 +175,7 @@ struct ForwardTinyView : std::ranges::view_base {
   constexpr ForwardTinyView(char c) { *c_ = c; }
   constexpr forward_iterator<const char*> begin() const { return forward_iterator<const char*>(c_); }
   constexpr forward_iterator<const char*> end() const { return forward_iterator<const char*>(c_ + 1); }
-  constexpr static size_t size() { return 1; }
+  constexpr static std::size_t size() { return 1; }
 };
 static_assert(std::ranges::forward_range<ForwardTinyView>);
 static_assert(std::ranges::view<ForwardTinyView>);

diff  --git a/libcxx/test/std/ranges/range.adaptors/range.reverse/size.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.reverse/size.pass.cpp
index d74b048dfb283..3d74bd2f074fa 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.reverse/size.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.reverse/size.pass.cpp
@@ -23,9 +23,9 @@
 template<CopyCategory CC>
 struct BidirSizedRange : std::ranges::view_base {
   int *ptr_;
-  size_t size_;
+  std::size_t size_;
 
-  constexpr BidirSizedRange(int *ptr, size_t size) : ptr_(ptr), size_(size) {}
+  constexpr BidirSizedRange(int *ptr, std::size_t size) : ptr_(ptr), size_(size) {}
   constexpr BidirSizedRange(const BidirSizedRange &) requires (CC == Copyable) = default;
   constexpr BidirSizedRange(BidirSizedRange &&) requires (CC == MoveOnly) = default;
   constexpr BidirSizedRange& operator=(const BidirSizedRange &) requires (CC == Copyable) = default;
@@ -36,7 +36,7 @@ struct BidirSizedRange : std::ranges::view_base {
   constexpr bidirectional_iterator<int*> end() { return bidirectional_iterator<int*>{ptr_ + 8}; }
   constexpr bidirectional_iterator<const int*> end() const { return bidirectional_iterator<const int*>{ptr_ + 8}; }
 
-  constexpr size_t size() const { return size_; }
+  constexpr std::size_t size() const { return size_; }
 };
 
 constexpr bool test() {
@@ -49,8 +49,8 @@ constexpr bool test() {
     assert(rev.size() == 4);
     assert(std::move(rev).size() == 4);
 
-    ASSERT_SAME_TYPE(decltype(rev.size()), size_t);
-    ASSERT_SAME_TYPE(decltype(std::move(rev).size()), size_t);
+    ASSERT_SAME_TYPE(decltype(rev.size()), std::size_t);
+    ASSERT_SAME_TYPE(decltype(std::move(rev).size()), std::size_t);
   }
   // Non-common, const bidirectional range.
   {
@@ -59,15 +59,15 @@ constexpr bool test() {
     assert(rev.size() == 4);
     assert(std::move(rev).size() == 4);
 
-    ASSERT_SAME_TYPE(decltype(rev.size()), size_t);
-    ASSERT_SAME_TYPE(decltype(std::move(rev).size()), size_t);
+    ASSERT_SAME_TYPE(decltype(rev.size()), std::size_t);
+    ASSERT_SAME_TYPE(decltype(std::move(rev).size()), std::size_t);
   }
   // Non-common, non-const (move only) bidirectional range.
   {
     auto rev = std::ranges::reverse_view(BidirSizedRange<MoveOnly>{buffer, 4});
     assert(std::move(rev).size() == 4);
 
-    ASSERT_SAME_TYPE(decltype(std::move(rev).size()), size_t);
+    ASSERT_SAME_TYPE(decltype(std::move(rev).size()), std::size_t);
   }
 
   return true;

diff  --git a/libcxx/test/std/ranges/range.adaptors/range.split/general.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.split/general.pass.cpp
index 8684e3b6cd9e7..5389d931f840e 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.split/general.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.split/general.pass.cpp
@@ -33,13 +33,13 @@ constexpr bool is_equal(View& view, const Expected& expected) {
   return std::ranges::equal(view, expected, std::ranges::equal);
 }
 
-template <class T, class Separator, class U, size_t M>
+template <class T, class Separator, class U, std::size_t M>
 constexpr bool test_function_call(T&& input, Separator&& separator, std::array<U, M> expected) {
   std::ranges::split_view v(input, separator);
   return is_equal(v, expected);
 }
 
-template <class T, class Separator, class U, size_t M>
+template <class T, class Separator, class U, std::size_t M>
 constexpr bool test_with_piping(T&& input, Separator&& separator, std::array<U, M> expected) {
   auto expected_it = expected.begin();
   for (auto e : input | std::ranges::views::split(separator)) {
@@ -124,7 +124,7 @@ constexpr std::string_view sv(T&& str) {
   return std::string_view(str);
 };
 
-template <class T, class Separator, class U, size_t M>
+template <class T, class Separator, class U, std::size_t M>
 constexpr void test_one(T&& input, Separator&& separator, std::array<U, M> expected) {
   assert(test_function_call(input, separator, expected));
   assert(test_with_piping(input, separator, expected));

diff  --git a/libcxx/test/std/ranges/range.adaptors/range.take/begin.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.take/begin.pass.cpp
index ad5442fee8021..f2ac62e764d59 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.take/begin.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.take/begin.pass.cpp
@@ -22,7 +22,7 @@
 struct NonCommonSimpleView : std::ranges::view_base {
   int* begin() const;
   sentinel_wrapper<int*> end() const;
-  size_t size() { return 0; }  // deliberately non-const
+  std::size_t size() { return 0; }  // deliberately non-const
 };
 static_assert(std::ranges::sized_range<NonCommonSimpleView>);
 static_assert(!std::ranges::sized_range<const NonCommonSimpleView>);

diff  --git a/libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp
index f51906675ec70..f48aae6d2887d 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp
@@ -39,7 +39,7 @@ auto toUpper(R range) {
   return std::ranges::transform_view(range, [](char c) { return std::toupper(c); });
 }
 
-template<class E1, class E2, size_t N, class Join = std::plus<E1>>
+template<class E1, class E2, std::size_t N, class Join = std::plus<E1>>
 auto joinArrays(E1 (&a)[N], E2 (&b)[N], Join join = Join()) {
   return std::ranges::transform_view(a, [&a, &b, join](auto& x) {
     auto idx = (&x) - a;

diff  --git a/libcxx/test/std/ranges/range.adaptors/range.transform/types.h b/libcxx/test/std/ranges/range.adaptors/range.transform/types.h
index d31db8d5a8146..14f85722a8c19 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.transform/types.h
+++ b/libcxx/test/std/ranges/range.adaptors/range.transform/types.h
@@ -9,6 +9,8 @@
 #ifndef TEST_STD_RANGES_RANGE_ADAPTORS_RANGE_TRANSFORM_TYPES_H
 #define TEST_STD_RANGES_RANGE_ADAPTORS_RANGE_TRANSFORM_TYPES_H
 
+#include <cstddef>
+
 #include "test_macros.h"
 #include "test_iterators.h"
 #include "test_range.h"
@@ -106,7 +108,7 @@ constexpr bool operator==(int* lhs, const RandomAccessIter &rhs) { return base(r
 struct SizedSentinelNotConstView : std::ranges::view_base {
   ForwardIter begin() const;
   int *end() const;
-  size_t size();
+  std::size_t size();
 };
 // TODO: remove these bogus operators
 bool operator==(const ForwardIter &lhs, int* rhs);

diff  --git a/libcxx/test/std/ranges/range.factories/range.single.view/size.pass.cpp b/libcxx/test/std/ranges/range.factories/range.single.view/size.pass.cpp
index 7d6a72db53b82..f57bc40acd156 100644
--- a/libcxx/test/std/ranges/range.factories/range.single.view/size.pass.cpp
+++ b/libcxx/test/std/ranges/range.factories/range.single.view/size.pass.cpp
@@ -20,28 +20,28 @@ constexpr bool test() {
     auto sv = std::ranges::single_view<int>(42);
     assert(sv.size() == 1);
 
-    ASSERT_SAME_TYPE(decltype(sv.size()), size_t);
+    ASSERT_SAME_TYPE(decltype(sv.size()), std::size_t);
     static_assert(noexcept(sv.size()));
   }
   {
     const auto sv = std::ranges::single_view<int>(42);
     assert(sv.size() == 1);
 
-    ASSERT_SAME_TYPE(decltype(sv.size()), size_t);
+    ASSERT_SAME_TYPE(decltype(sv.size()), std::size_t);
     static_assert(noexcept(sv.size()));
   }
   {
     auto sv = std::ranges::single_view<int>(42);
     assert(std::ranges::size(sv) == 1);
 
-    ASSERT_SAME_TYPE(decltype(std::ranges::size(sv)), size_t);
+    ASSERT_SAME_TYPE(decltype(std::ranges::size(sv)), std::size_t);
     static_assert(noexcept(std::ranges::size(sv)));
   }
   {
     const auto sv = std::ranges::single_view<int>(42);
     assert(std::ranges::size(sv) == 1);
 
-    ASSERT_SAME_TYPE(decltype(std::ranges::size(sv)), size_t);
+    ASSERT_SAME_TYPE(decltype(std::ranges::size(sv)), std::size_t);
     static_assert(noexcept(std::ranges::size(sv)));
   }
 
@@ -49,7 +49,7 @@ constexpr bool test() {
   {
     assert(std::ranges::single_view<int>::size() == 1);
 
-    ASSERT_SAME_TYPE(decltype(std::ranges::single_view<int>::size()), size_t);
+    ASSERT_SAME_TYPE(decltype(std::ranges::single_view<int>::size()), std::size_t);
     static_assert(noexcept(std::ranges::single_view<int>::size()));
   }
 

diff  --git a/libcxx/test/std/ranges/range.utility/range.subrange/ctor.begin_end_size.pass.cpp b/libcxx/test/std/ranges/range.utility/range.subrange/ctor.begin_end_size.pass.cpp
index c83e83b62eb80..52a66f6b10b33 100644
--- a/libcxx/test/std/ranges/range.utility/range.subrange/ctor.begin_end_size.pass.cpp
+++ b/libcxx/test/std/ranges/range.utility/range.subrange/ctor.begin_end_size.pass.cpp
@@ -28,8 +28,8 @@ static_assert( std::is_constructible_v<SizedSentinelForwardSubrange, Conditional
 static_assert(!std::is_constructible_v<SizedSentinelForwardSubrange, Empty, ConditionallyConvertibleIter, ConditionallyConvertibleIter::u
diff erence_type>); // 1.
 static_assert( std::is_constructible_v<ConvertibleSizedSentinelForwardSubrange, ConvertibleSizedSentinelForwardIter, int*, ConvertibleSizedSentinelForwardIter::u
diff erence_type>); // 2.
 static_assert( std::is_constructible_v<SizedSentinelForwardSubrange, ConditionallyConvertibleIter, ConditionallyConvertibleIter, ConditionallyConvertibleIter::u
diff erence_type>); // 3. (Same as default case.)
-static_assert(!std::is_constructible_v<SizedIntPtrSubrange, long*, int*, size_t>); // 4.
-static_assert( std::is_constructible_v<SizedIntPtrSubrange, int*, int*, size_t>); // 5.
+static_assert(!std::is_constructible_v<SizedIntPtrSubrange, long*, int*, std::size_t>); // 4.
+static_assert( std::is_constructible_v<SizedIntPtrSubrange, int*, int*, std::size_t>); // 5.
 
 constexpr bool test() {
   SizedSentinelForwardSubrange a(ConditionallyConvertibleIter(globalBuff), ConditionallyConvertibleIter(globalBuff + 8), 8);

diff  --git a/libcxx/test/std/ranges/range.utility/range.subrange/get.pass.cpp b/libcxx/test/std/ranges/range.utility/range.subrange/get.pass.cpp
index 5e8969b8d408f..e1daf887a015e 100644
--- a/libcxx/test/std/ranges/range.utility/range.subrange/get.pass.cpp
+++ b/libcxx/test/std/ranges/range.utility/range.subrange/get.pass.cpp
@@ -16,7 +16,7 @@
 #include "test_macros.h"
 #include "test_iterators.h"
 
-template<size_t I, class S>
+template<std::size_t I, class S>
 concept HasGet = requires {
   std::get<I>(std::declval<S>());
 };

diff  --git a/libcxx/test/std/ranges/range.utility/range.subrange/types.h b/libcxx/test/std/ranges/range.utility/range.subrange/types.h
index e730d6ae05116..865935019e0fd 100644
--- a/libcxx/test/std/ranges/range.utility/range.subrange/types.h
+++ b/libcxx/test/std/ranges/range.utility/range.subrange/types.h
@@ -211,7 +211,7 @@ struct DifferentSentinelWithSizeMember {
 
   constexpr ForwardIter begin() const { return ForwardIter(globalBuff); }
   constexpr sentinel end() const { return sentinel{globalBuff + 8}; }
-  constexpr size_t size() const { return 8; }
+  constexpr std::size_t size() const { return 8; }
 };
 
 template<>

diff  --git a/libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp b/libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp
index b1ed28f80e914..2fc2fa8579996 100644
--- a/libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp
+++ b/libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp
@@ -95,7 +95,7 @@ struct SizeIsTen : std::ranges::view_interface<SizeIsTen> {
   int buff[8] = {0, 1, 2, 3, 4, 5, 6, 7};
   constexpr ForwardIter begin() const { return ForwardIter(const_cast<int*>(buff)); }
   constexpr ForwardIter end() const { return ForwardIter(const_cast<int*>(buff) + 8); }
-  constexpr size_t size() const { return 10; }
+  constexpr std::size_t size() const { return 10; }
 };
 static_assert(std::ranges::view<SizeIsTen>);
 
@@ -262,7 +262,7 @@ constexpr bool testSize() {
 }
 
 template<class T>
-concept SubscriptInvocable = requires (T const& obj, size_t n) { obj[n]; };
+concept SubscriptInvocable = requires (T const& obj, std::size_t n) { obj[n]; };
 
 constexpr bool testSubscript() {
   static_assert(!SubscriptInvocable<ForwardRange>);

diff  --git a/libcxx/test/std/re/re.alg/re.alg.match/awk.locale.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/awk.locale.pass.cpp
index 7d53cd9ee3698..6470b95b4edc1 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/awk.locale.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/awk.locale.pass.cpp
@@ -44,7 +44,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -60,7 +60,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -87,7 +87,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -103,7 +103,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp
index f3385f4891aa6..988beec15e644 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp
@@ -260,7 +260,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -275,7 +275,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -290,7 +290,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -323,7 +323,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -338,7 +338,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -353,7 +353,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -375,7 +375,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -391,7 +391,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -407,7 +407,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 4);
@@ -431,7 +431,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -516,7 +516,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -539,7 +539,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -569,7 +569,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -585,7 +585,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -601,7 +601,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -643,7 +643,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == 4);
+        assert((std::size_t)m.length(0) == 4);
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -659,7 +659,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == s + std::char_traits<char>::length(s));
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -677,7 +677,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == s+1);
-        assert((size_t)m.length(0) == 1);
+        assert((std::size_t)m.length(0) == 1);
         assert(m.position(0) == 0);
         assert(m.str(0) == L"a");
     }
@@ -692,7 +692,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == s+2);
-        assert((size_t)m.length(0) == 2);
+        assert((std::size_t)m.length(0) == 2);
         assert(m.position(0) == 0);
         assert(m.str(0) == L"ab");
     }
@@ -902,7 +902,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -917,7 +917,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -932,7 +932,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -965,7 +965,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -980,7 +980,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -995,7 +995,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1017,7 +1017,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1033,7 +1033,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1049,7 +1049,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 4);
@@ -1073,7 +1073,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1158,7 +1158,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1181,7 +1181,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1211,7 +1211,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1227,7 +1227,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1243,7 +1243,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1301,7 +1301,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == s + std::char_traits<wchar_t>::length(s));
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.match/basic.locale.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/basic.locale.pass.cpp
index 488385f266c90..430d35fe739e5 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/basic.locale.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/basic.locale.pass.cpp
@@ -46,7 +46,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -62,7 +62,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -89,7 +89,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -105,7 +105,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp
index d77349d59ec0f..9765a07f2e4fe 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp
@@ -380,7 +380,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 2);
@@ -398,7 +398,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 3);
@@ -423,7 +423,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 3);
@@ -518,7 +518,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -541,7 +541,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -571,7 +571,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -587,7 +587,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -603,7 +603,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -894,7 +894,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -909,7 +909,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -924,7 +924,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -957,7 +957,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -972,7 +972,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -987,7 +987,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1008,7 +1008,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 2);
@@ -1026,7 +1026,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 3);
@@ -1051,7 +1051,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 3);
@@ -1146,7 +1146,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1169,7 +1169,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1199,7 +1199,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1215,7 +1215,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1231,7 +1231,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.match/ecma.locale.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/ecma.locale.pass.cpp
index 0f49b9f463fb4..b512fa9b5fcf8 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/ecma.locale.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/ecma.locale.pass.cpp
@@ -45,7 +45,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -61,7 +61,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -86,7 +86,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -102,7 +102,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp
index 58502aa6e1970..4face8ba02bbe 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp
@@ -259,7 +259,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -274,7 +274,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -289,7 +289,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -322,7 +322,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -337,7 +337,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -352,7 +352,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -374,7 +374,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -392,7 +392,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -407,7 +407,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 4);
@@ -431,7 +431,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -509,7 +509,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -530,7 +530,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -557,7 +557,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -572,7 +572,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -587,7 +587,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -665,7 +665,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == s + std::char_traits<char>::length(s));
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -907,7 +907,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -922,7 +922,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -937,7 +937,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -970,7 +970,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -985,7 +985,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1000,7 +1000,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1022,7 +1022,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1040,7 +1040,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1055,7 +1055,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 4);
@@ -1079,7 +1079,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1157,7 +1157,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1178,7 +1178,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1205,7 +1205,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1220,7 +1220,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1235,7 +1235,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1301,7 +1301,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == s + std::char_traits<wchar_t>::length(s));
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.match/extended.locale.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/extended.locale.pass.cpp
index 1e7ded603b96f..472dc19680263 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/extended.locale.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/extended.locale.pass.cpp
@@ -46,7 +46,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -62,7 +62,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -89,7 +89,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -105,7 +105,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp
index b3be567d2ab24..73c1d8352ab2b 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp
@@ -259,7 +259,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -274,7 +274,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -289,7 +289,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -322,7 +322,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -337,7 +337,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -352,7 +352,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -374,7 +374,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -390,7 +390,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -406,7 +406,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 4);
@@ -430,7 +430,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 2);
@@ -448,7 +448,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -533,7 +533,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -556,7 +556,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -586,7 +586,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -602,7 +602,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -618,7 +618,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -903,7 +903,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -918,7 +918,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -933,7 +933,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -966,7 +966,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -981,7 +981,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -996,7 +996,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1018,7 +1018,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1034,7 +1034,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1050,7 +1050,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 4);
@@ -1074,7 +1074,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 2);
@@ -1092,7 +1092,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1177,7 +1177,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1200,7 +1200,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1230,7 +1230,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1246,7 +1246,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1262,7 +1262,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.search/awk.locale.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/awk.locale.pass.cpp
index f2a89d6736827..9125df404b1de 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/awk.locale.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/awk.locale.pass.cpp
@@ -46,7 +46,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -62,7 +62,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -89,7 +89,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -105,7 +105,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp
index 741a74f319043..2c23cf0f70079 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp
@@ -323,7 +323,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -338,7 +338,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -353,7 +353,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -386,7 +386,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -401,7 +401,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -416,7 +416,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -438,7 +438,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -454,7 +454,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -470,7 +470,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 4);
@@ -494,7 +494,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -588,7 +588,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -611,7 +611,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -641,7 +641,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -657,7 +657,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -673,7 +673,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -749,7 +749,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == s + std::char_traits<char>::length(s));
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1055,7 +1055,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1070,7 +1070,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1085,7 +1085,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1118,7 +1118,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1133,7 +1133,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1148,7 +1148,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1170,7 +1170,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1186,7 +1186,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1202,7 +1202,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 4);
@@ -1226,7 +1226,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1320,7 +1320,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1343,7 +1343,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1373,7 +1373,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1389,7 +1389,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1405,7 +1405,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1481,7 +1481,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == s + std::char_traits<wchar_t>::length(s));
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.search/basic.locale.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/basic.locale.pass.cpp
index fff693edd738e..f85b6a40ce129 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/basic.locale.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/basic.locale.pass.cpp
@@ -46,7 +46,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -62,7 +62,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -89,7 +89,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -105,7 +105,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp
index 287ca9999b48c..99f94f26b32ae 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp
@@ -443,7 +443,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 2);
@@ -461,7 +461,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 3);
@@ -486,7 +486,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 3);
@@ -590,7 +590,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -613,7 +613,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -643,7 +643,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -659,7 +659,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -675,7 +675,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1047,7 +1047,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1062,7 +1062,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1077,7 +1077,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1110,7 +1110,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1125,7 +1125,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1140,7 +1140,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1161,7 +1161,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 2);
@@ -1179,7 +1179,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 3);
@@ -1204,7 +1204,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 3);
@@ -1308,7 +1308,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1331,7 +1331,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1361,7 +1361,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1377,7 +1377,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1393,7 +1393,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.search/ecma.locale.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/ecma.locale.pass.cpp
index bb80b16fc60ae..aa9441cb3e58f 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/ecma.locale.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/ecma.locale.pass.cpp
@@ -45,7 +45,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -61,7 +61,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -86,7 +86,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -102,7 +102,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp
index 00977d398dee3..518c27e424484 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp
@@ -322,7 +322,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -337,7 +337,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -352,7 +352,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -385,7 +385,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -400,7 +400,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -415,7 +415,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -467,7 +467,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 4);
@@ -491,7 +491,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -578,7 +578,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -599,7 +599,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -626,7 +626,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -641,7 +641,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -656,7 +656,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -758,7 +758,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == s + std::char_traits<char>::length(s));
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1063,7 +1063,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1078,7 +1078,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1093,7 +1093,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1126,7 +1126,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1141,7 +1141,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1156,7 +1156,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1208,7 +1208,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 4);
@@ -1232,7 +1232,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1319,7 +1319,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1340,7 +1340,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1367,7 +1367,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1382,7 +1382,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1397,7 +1397,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1499,7 +1499,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == s + std::char_traits<wchar_t>::length(s));
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.search/extended.locale.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/extended.locale.pass.cpp
index bbe39e7657b7b..9746e45f29da5 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/extended.locale.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/extended.locale.pass.cpp
@@ -46,7 +46,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -62,7 +62,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -89,7 +89,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -105,7 +105,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp
index 8ffedfcb263eb..0ddb49d619a18 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp
@@ -323,7 +323,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -338,7 +338,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -353,7 +353,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -386,7 +386,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -401,7 +401,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -416,7 +416,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -438,7 +438,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -454,7 +454,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -470,7 +470,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 4);
@@ -494,7 +494,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 2);
@@ -512,7 +512,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -606,7 +606,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -629,7 +629,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -659,7 +659,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -675,7 +675,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -691,7 +691,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1057,7 +1057,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1072,7 +1072,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1087,7 +1087,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1120,7 +1120,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1135,7 +1135,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1150,7 +1150,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1172,7 +1172,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1188,7 +1188,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1204,7 +1204,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 4);
@@ -1228,7 +1228,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 2);
@@ -1246,7 +1246,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1340,7 +1340,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1363,7 +1363,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1393,7 +1393,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1409,7 +1409,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1425,7 +1425,7 @@ int main(int, char**)
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.search/grep.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/grep.pass.cpp
index 29300a818119b..3569ad53ee60b 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/grep.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/grep.pass.cpp
@@ -24,7 +24,7 @@
 extern "C" void LLVMFuzzerTestOneInput(const char *data)
 {
 #ifndef TEST_HAS_NO_EXCEPTIONS
-    size_t size = strlen(data);
+    std::size_t size = strlen(data);
     if (size > 0)
     {
         try

diff  --git a/libcxx/test/std/strings/basic.string.hash/char_type_hash.fail.cpp b/libcxx/test/std/strings/basic.string.hash/char_type_hash.fail.cpp
index 721d7e65b39cc..339b200806e2b 100644
--- a/libcxx/test/std/strings/basic.string.hash/char_type_hash.fail.cpp
+++ b/libcxx/test/std/strings/basic.string.hash/char_type_hash.fail.cpp
@@ -33,14 +33,14 @@ struct trait // copied from <__string>
     static inline bool eq(char_type __c1, char_type __c2) { return __c1 == __c2; }
     static inline bool lt(char_type __c1, char_type __c2) { return __c1 < __c2; }
 
-    static int compare(const char_type* __s1, const char_type* __s2, size_t __n);
-    static size_t length(const char_type* __s);
-    static const char_type* find(const char_type* __s, size_t __n,
+    static int compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
+    static std::size_t length(const char_type* __s);
+    static const char_type* find(const char_type* __s, std::size_t __n,
                                  const char_type& __a);
 
-    static char_type* move(char_type* __s1, const char_type* __s2, size_t __n);
-    static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n);
-    static char_type* assign(char_type* __s, size_t __n, char_type __a);
+    static char_type* move(char_type* __s1, const char_type* __s2, std::size_t __n);
+    static char_type* copy(char_type* __s1, const char_type* __s2, std::size_t __n);
+    static char_type* assign(char_type* __s, std::size_t __n, char_type __a);
 
     static inline int_type not_eof(int_type __c) {
         return eq_int_type(__c, eof()) ? ~eof() : __c;

diff  --git a/libcxx/test/std/strings/basic.string.hash/enabled_hashes.pass.cpp b/libcxx/test/std/strings/basic.string.hash/enabled_hashes.pass.cpp
index f79b0d9162eba..31e351a698652 100644
--- a/libcxx/test/std/strings/basic.string.hash/enabled_hashes.pass.cpp
+++ b/libcxx/test/std/strings/basic.string.hash/enabled_hashes.pass.cpp
@@ -36,12 +36,12 @@ struct std::char_traits<MyChar> {
   static bool eq(char_type, char_type);
   static bool lt(char_type, char_type);
 
-  static int              compare(const char_type*, const char_type*, size_t);
-  static size_t           length(const char_type*);
-  static const char_type* find(const char_type*, size_t, const char_type&);
-  static char_type*       move(char_type*, const char_type*, size_t);
-  static char_type*       copy(char_type*, const char_type*, size_t);
-  static char_type*       assign(char_type*, size_t, char_type);
+  static int              compare(const char_type*, const char_type*, std::size_t);
+  static std::size_t           length(const char_type*);
+  static const char_type* find(const char_type*, std::size_t, const char_type&);
+  static char_type*       move(char_type*, const char_type*, std::size_t);
+  static char_type*       copy(char_type*, const char_type*, std::size_t);
+  static char_type*       assign(char_type*, std::size_t, char_type);
 
   static int_type  not_eof(int_type);
   static char_type to_char_type(int_type);

diff  --git a/libcxx/test/std/strings/basic.string/string.capacity/max_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.capacity/max_size.pass.cpp
index b8e4198f54d46..ca4b05b8b055a 100644
--- a/libcxx/test/std/strings/basic.string/string.capacity/max_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.capacity/max_size.pass.cpp
@@ -30,7 +30,7 @@ TEST_CONSTEXPR_CXX20 void
 test1(const S& s)
 {
     S s2(s);
-    const size_t sz = s2.max_size() - 1;
+    const std::size_t sz = s2.max_size() - 1;
     try { s2.resize(sz, 'x'); }
     catch ( const std::bad_alloc & ) { return ; }
     assert ( s2.size() ==  sz );
@@ -41,7 +41,7 @@ TEST_CONSTEXPR_CXX20 void
 test2(const S& s)
 {
     S s2(s);
-    const size_t sz = s2.max_size();
+    const std::size_t sz = s2.max_size();
     try { s2.resize(sz, 'x'); }
     catch ( const std::bad_alloc & ) { return ; }
     assert ( s.size() ==  sz );
@@ -76,7 +76,7 @@ TEST_CONSTEXPR_CXX20 bool test() {
 constexpr bool test_constexpr() {
   std::string str;
 
-  size_t size = str.max_size();
+  std::size_t size = str.max_size();
   assert(size > 0);
 
   return true;

diff  --git a/libcxx/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp
index 65907e03b0e2f..7fcf0c6a6cea2 100644
--- a/libcxx/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp
@@ -31,7 +31,7 @@ test(const S& s)
 {
     assert(s.max_size() >= s.size());
     S s2(s);
-    const size_t sz = s2.max_size() + 1;
+    const std::size_t sz = s2.max_size() + 1;
     try { s2.resize(sz, 'x'); }
     catch ( const std::length_error & ) { return ; }
     assert ( false );

diff  --git a/libcxx/test/std/strings/basic.string/string.capacity/resize_and_overwrite.pass.cpp b/libcxx/test/std/strings/basic.string/string.capacity/resize_and_overwrite.pass.cpp
index b22a9036e70f2..3fafde81e8abf 100644
--- a/libcxx/test/std/strings/basic.string/string.capacity/resize_and_overwrite.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.capacity/resize_and_overwrite.pass.cpp
@@ -21,7 +21,7 @@
 #include "test_macros.h"
 
 template <class S>
-constexpr void test_appending(size_t k, size_t N, size_t new_capacity) {
+constexpr void test_appending(std::size_t k, size_t N, size_t new_capacity) {
   assert(N > k);
   assert(new_capacity >= N);
   auto s = S(k, 'a');
@@ -40,7 +40,7 @@ constexpr void test_appending(size_t k, size_t N, size_t new_capacity) {
 }
 
 template <class S>
-constexpr void test_truncating(size_t o, size_t N) {
+constexpr void test_truncating(std::size_t o, size_t N) {
   assert(N < o);
   auto s = S(o, 'a');
   s.resize_and_overwrite(N, [&](auto* p, auto n) {
@@ -76,10 +76,10 @@ constexpr bool test() {
 
 void test_value_categories() {
   std::string s;
-  s.resize_and_overwrite(10, [](char*&&, size_t&&) { return 0; });
-  s.resize_and_overwrite(10, [](char* const&, const size_t&) { return 0; });
+  s.resize_and_overwrite(10, [](char*&&, std::size_t&&) { return 0; });
+  s.resize_and_overwrite(10, [](char* const&, const std::size_t&) { return 0; });
   struct RefQualified {
-    int operator()(char*, size_t) && { return 0; }
+    int operator()(char*, std::size_t) && { return 0; }
   };
   s.resize_and_overwrite(10, RefQualified{});
 }

diff  --git a/libcxx/test/std/strings/basic.string/string.capacity/shrink_to_fit.explicit_instantiation.sh.cpp b/libcxx/test/std/strings/basic.string/string.capacity/shrink_to_fit.explicit_instantiation.sh.cpp
index 195491f45045e..9f0f2ed714bcf 100644
--- a/libcxx/test/std/strings/basic.string/string.capacity/shrink_to_fit.explicit_instantiation.sh.cpp
+++ b/libcxx/test/std/strings/basic.string/string.capacity/shrink_to_fit.explicit_instantiation.sh.cpp
@@ -34,12 +34,12 @@ struct string16_char_traits {
   static void assign(char_type&, const char_type&) { }
   static bool eq(const char_type&, const char_type&) { return false; }
   static bool lt(const char_type&, const char_type&) { return false; }
-  static int compare(const char_type*, const char_type*, size_t) { return 0; }
-  static size_t length(const char_type*) { return 0; }
-  static const char_type* find(const char_type*, size_t, const char_type&) { return nullptr; }
-  static char_type* move(char_type*, const char_type*, size_t) { return nullptr; }
-  static char_type* copy(char_type*, const char_type*, size_t) { return nullptr; }
-  static char_type* assign(char_type*, size_t, char_type) { return nullptr; }
+  static int compare(const char_type*, const char_type*, std::size_t) { return 0; }
+  static std::size_t length(const char_type*) { return 0; }
+  static const char_type* find(const char_type*, std::size_t, const char_type&) { return nullptr; }
+  static char_type* move(char_type*, const char_type*, std::size_t) { return nullptr; }
+  static char_type* copy(char_type*, const char_type*, std::size_t) { return nullptr; }
+  static char_type* assign(char_type*, std::size_t, char_type) { return nullptr; }
   static int_type not_eof(const int_type&) { return 0; }
   static char_type to_char_type(const int_type&) { return char_type(); }
   static int_type to_int_type(const char_type&) { return int_type(); }

diff  --git a/libcxx/test/std/strings/basic.string/string.cons/dtor.pass.cpp b/libcxx/test/std/strings/basic.string/string.cons/dtor.pass.cpp
index 07e9a60397d42..92d6531224cc1 100644
--- a/libcxx/test/std/strings/basic.string/string.cons/dtor.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.cons/dtor.pass.cpp
@@ -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);
 };
 

diff  --git a/libcxx/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp b/libcxx/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp
index f9cdeac8b203e..5f3064bc0452b 100644
--- a/libcxx/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp
@@ -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");
 

diff  --git a/libcxx/test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp b/libcxx/test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp
index c2b97ecb3ec00..1e24c20b4b101 100644
--- a/libcxx/test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp
@@ -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;

diff  --git a/libcxx/test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp b/libcxx/test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp
index 7d9cf9aecd900..809ed97decd79 100644
--- a/libcxx/test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp
@@ -35,15 +35,15 @@ namespace std {
     static bool eq(char_type c1, char_type c2);
     static bool lt(char_type c1, char_type c2);
 
-    static int compare(const char_type* s1, const char_type* s2, size_t n);
-    static size_t length(const char_type* s);
-    static const char_type* find(const char_type* s, size_t n, const char_type& a);
-    static char_type* move(char_type* s1, const char_type* s2, size_t n);
-    static TEST_CONSTEXPR_CXX20 char_type* copy(char_type* s1, const char_type* s2, size_t n) {
+    static int compare(const char_type* s1, const char_type* s2, std::size_t n);
+    static std::size_t length(const char_type* s);
+    static const char_type* find(const char_type* s, std::size_t n, const char_type& a);
+    static char_type* move(char_type* s1, const char_type* s2, std::size_t n);
+    static TEST_CONSTEXPR_CXX20 char_type* copy(char_type* s1, const char_type* s2, std::size_t n) {
       std::copy_n(s2, n, s1);
       return s1;
     }
-    static TEST_CONSTEXPR_CXX20 char_type* assign(char_type* s, size_t n, char_type a) {
+    static TEST_CONSTEXPR_CXX20 char_type* assign(char_type* s, std::size_t n, char_type a) {
       std::fill_n(s, n, a);
       return s;
     }

diff  --git a/libcxx/test/std/strings/basic.string/string.nonmembers/string.cmp/comparison.pass.cpp b/libcxx/test/std/strings/basic.string/string.nonmembers/string.cmp/comparison.pass.cpp
index d9f71bd31e62a..03b3b98df8d94 100644
--- a/libcxx/test/std/strings/basic.string/string.nonmembers/string.cmp/comparison.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.nonmembers/string.cmp/comparison.pass.cpp
@@ -59,8 +59,8 @@ constexpr void test() {
   };
   static_assert(v.size() == vn.size());
 
-  for (size_t i = 0; i < v.size(); ++i) {
-    for (size_t j = 0; j < v.size(); ++j) {
+  for (std::size_t i = 0; i < v.size(); ++i) {
+    for (std::size_t j = 0; j < v.size(); ++j) {
       assert(testOrder(v[i], v[j], i == j ? Ordering::equivalent : i < j ? Ordering::less : Ordering::greater));
 
       assert(testOrder(

diff  --git a/libcxx/test/std/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp b/libcxx/test/std/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp
index de820028e2602..9a5513b90c111 100644
--- a/libcxx/test/std/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp
@@ -34,7 +34,7 @@ struct some_alloc
 
     some_alloc() {}
     some_alloc(const some_alloc&);
-    T *allocate(size_t);
+    T *allocate(std::size_t);
     void deallocate(void*, unsigned) {}
     typedef std::true_type propagate_on_container_swap;
 };
@@ -46,7 +46,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_swap;

diff  --git a/libcxx/test/std/strings/basic.string/string.require/contiguous.pass.cpp b/libcxx/test/std/strings/basic.string/string.require/contiguous.pass.cpp
index f7087fd3c5d95..822f1a6171a1b 100644
--- a/libcxx/test/std/strings/basic.string/string.require/contiguous.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.require/contiguous.pass.cpp
@@ -21,7 +21,7 @@
 template <class C>
 TEST_CONSTEXPR_CXX20 void test_contiguous ( const C &c )
 {
-    for ( size_t i = 0; i < c.size(); ++i )
+    for ( std::size_t i = 0; i < c.size(); ++i )
         assert ( *(c.begin() + static_cast<typename C::
diff erence_type>(i)) == *(std::addressof(*c.begin()) + i));
 }
 

diff  --git a/libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp b/libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp
index 909f2c025bdf8..775f4cd2272fa 100644
--- a/libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp
+++ b/libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp
@@ -24,12 +24,12 @@
 // __STDC_UTF_32__ may or may not be defined by the C standard library
 
 #if !defined(TEST_HAS_NO_C8RTOMB_MBRTOC8)
-ASSERT_SAME_TYPE(size_t, decltype(std::mbrtoc8((char8_t*)0, (const char*)0, (size_t)0, (mbstate_t*)0)));
-ASSERT_SAME_TYPE(size_t, decltype(std::c8rtomb((char*)0, (char8_t)0, (mbstate_t*)0)));
+ASSERT_SAME_TYPE(std::size_t, decltype(std::mbrtoc8((char8_t*)0, (const char*)0, (size_t)0, (mbstate_t*)0)));
+ASSERT_SAME_TYPE(std::size_t, decltype(std::c8rtomb((char*)0, (char8_t)0, (mbstate_t*)0)));
 #endif
 
-ASSERT_SAME_TYPE(size_t, decltype(std::mbrtoc16((char16_t*)0, (const char*)0, (size_t)0, (mbstate_t*)0)));
-ASSERT_SAME_TYPE(size_t, decltype(std::c16rtomb((char*)0, (char16_t)0, (mbstate_t*)0)));
+ASSERT_SAME_TYPE(std::size_t, decltype(std::mbrtoc16((char16_t*)0, (const char*)0, (size_t)0, (mbstate_t*)0)));
+ASSERT_SAME_TYPE(std::size_t, decltype(std::c16rtomb((char*)0, (char16_t)0, (mbstate_t*)0)));
 
-ASSERT_SAME_TYPE(size_t, decltype(std::mbrtoc32((char32_t*)0, (const char*)0, (size_t)0, (mbstate_t*)0)));
-ASSERT_SAME_TYPE(size_t, decltype(std::c16rtomb((char*)0, (char32_t)0, (mbstate_t*)0)));
+ASSERT_SAME_TYPE(std::size_t, decltype(std::mbrtoc32((char32_t*)0, (const char*)0, (size_t)0, (mbstate_t*)0)));
+ASSERT_SAME_TYPE(std::size_t, decltype(std::c16rtomb((char*)0, (char32_t)0, (mbstate_t*)0)));

diff  --git a/libcxx/test/std/strings/string.conversions/stod.pass.cpp b/libcxx/test/std/strings/string.conversions/stod.pass.cpp
index bc553adc4a7f0..dbf10a4948de4 100644
--- a/libcxx/test/std/strings/string.conversions/stod.pass.cpp
+++ b/libcxx/test/std/strings/string.conversions/stod.pass.cpp
@@ -27,29 +27,29 @@ int main(int, char**)
         assert(std::stod("-10") == -10);
         assert(std::stod(" 10") == 10);
         {
-            size_t idx = 0;
+            std::size_t idx = 0;
             assert(std::stod("10g", &idx) == 10);
             assert(idx == 2);
         }
         {
-            size_t idx = 0;
+            std::size_t idx = 0;
             assert(std::stod("1.e60", &idx) == 1.e60);
             assert(idx == 5);
         }
         {
-            size_t idx = 0;
+            std::size_t idx = 0;
             assert(std::stod("INF", &idx) == INFINITY);
             assert(idx == 3);
         }
         {
-            size_t idx = 0;
+            std::size_t idx = 0;
             assert(std::isnan(std::stod("NAN", &idx)));
             assert(idx == 3);
         }
 
 #ifndef TEST_HAS_NO_EXCEPTIONS
         {
-            size_t idx = 0;
+            std::size_t idx = 0;
             try {
                 assert(std::stod("1.e360", &idx) == INFINITY);
                 assert(false);
@@ -58,7 +58,7 @@ int main(int, char**)
             }
         }
         {
-            size_t idx = 0;
+            std::size_t idx = 0;
             try {
                 (void)std::stod("", &idx);
                 assert(false);
@@ -67,7 +67,7 @@ int main(int, char**)
             }
         }
         {
-            size_t idx = 0;
+            std::size_t idx = 0;
             try {
                 (void)std::stod("  - 8", &idx);
                 assert(false);
@@ -76,7 +76,7 @@ int main(int, char**)
             }
         }
         {
-            size_t idx = 0;
+            std::size_t idx = 0;
             try {
                 (void)std::stod("a1", &idx);
                 assert(false);
@@ -95,28 +95,28 @@ int main(int, char**)
         assert(std::stod(L"-10.5") == -10.5);
         assert(std::stod(L" 10") == 10);
         {
-            size_t idx = 0;
+            std::size_t idx = 0;
             assert(std::stod(L"10g", &idx) == 10);
             assert(idx == 2);
         }
         {
-            size_t idx = 0;
+            std::size_t idx = 0;
             assert(std::stod(L"1.e60", &idx) == 1.e60);
             assert(idx == 5);
         }
         {
-            size_t idx = 0;
+            std::size_t idx = 0;
             assert(std::stod(L"INF", &idx) == INFINITY);
             assert(idx == 3);
         }
         {
-            size_t idx = 0;
+            std::size_t idx = 0;
             assert(std::isnan(std::stod(L"NAN", &idx)));
             assert(idx == 3);
         }
 #ifndef TEST_HAS_NO_EXCEPTIONS
         {
-            size_t idx = 0;
+            std::size_t idx = 0;
             try {
                 assert(std::stod(L"1.e360", &idx) == INFINITY);
                 assert(false);
@@ -125,7 +125,7 @@ int main(int, char**)
             }
         }
         {
-            size_t idx = 0;
+            std::size_t idx = 0;
             try {
                 (void)std::stod(L"", &idx);
                 assert(false);
@@ -134,7 +134,7 @@ int main(int, char**)
             }
         }
         {
-            size_t idx = 0;
+            std::size_t idx = 0;
             try {
                 (void)std::stod(L"  - 8", &idx);
                 assert(false);
@@ -143,7 +143,7 @@ int main(int, char**)
             }
         }
         {
-            size_t idx = 0;
+            std::size_t idx = 0;
             try {
                 (void)std::stod(L"a1", &idx);
                 assert(false);

diff  --git a/libcxx/test/std/strings/string.conversions/stof.pass.cpp b/libcxx/test/std/strings/string.conversions/stof.pass.cpp
index da4bddd575015..d95e5d1b10a86 100644
--- a/libcxx/test/std/strings/string.conversions/stof.pass.cpp
+++ b/libcxx/test/std/strings/string.conversions/stof.pass.cpp
@@ -25,23 +25,23 @@ int main(int, char**)
     assert(std::stof("-10") == -10);
     assert(std::stof(" 10") == 10);
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         assert(std::stof("10g", &idx) == 10);
         assert(idx == 2);
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         assert(std::stof("INF", &idx) == INFINITY);
         assert(idx == 3);
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         assert(std::isnan(std::stof("NAN", &idx)));
         assert(idx == 3);
     }
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             assert(std::stof("1.e60", &idx) == INFINITY);
             assert(false);
@@ -50,7 +50,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             assert(std::stof("1.e360", &idx) == INFINITY);
             assert(false);
@@ -59,7 +59,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stof("", &idx);
             assert(false);
@@ -68,7 +68,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stof("  - 8", &idx);
             assert(false);
@@ -77,7 +77,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stof("a1", &idx);
             assert(false);
@@ -93,23 +93,23 @@ int main(int, char**)
     assert(std::stof(L"-10.5") == -10.5);
     assert(std::stof(L" 10") == 10);
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         assert(std::stof(L"10g", &idx) == 10);
         assert(idx == 2);
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         assert(std::stof(L"INF", &idx) == INFINITY);
         assert(idx == 3);
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         assert(std::isnan(std::stof(L"NAN", &idx)));
         assert(idx == 3);
     }
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             assert(std::stof(L"1.e60", &idx) == INFINITY);
             assert(false);
@@ -118,7 +118,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             assert(std::stof(L"1.e360", &idx) == INFINITY);
             assert(false);
@@ -127,7 +127,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stof(L"", &idx);
             assert(false);
@@ -136,7 +136,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stof(L"  - 8", &idx);
             assert(false);
@@ -145,7 +145,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stof(L"a1", &idx);
             assert(false);

diff  --git a/libcxx/test/std/strings/string.conversions/stoi.pass.cpp b/libcxx/test/std/strings/string.conversions/stoi.pass.cpp
index 8a8ea645fc268..f7650e3d245f9 100644
--- a/libcxx/test/std/strings/string.conversions/stoi.pass.cpp
+++ b/libcxx/test/std/strings/string.conversions/stoi.pass.cpp
@@ -24,13 +24,13 @@ int main(int, char**)
     assert(std::stoi("-10") == -10);
     assert(std::stoi(" 10") == 10);
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         assert(std::stoi("10g", &idx, 16) == 16);
         assert(idx == 2);
     }
 #ifndef TEST_HAS_NO_EXCEPTIONS
     if (std::numeric_limits<long>::max() > std::numeric_limits<int>::max()) {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stoi("0x100000000", &idx, 16);
             assert(false);
@@ -39,7 +39,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stoi("", &idx);
             assert(false);
@@ -48,7 +48,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stoi("  - 8", &idx);
             assert(false);
@@ -57,7 +57,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stoi("a1", &idx);
             assert(false);
@@ -73,13 +73,13 @@ int main(int, char**)
     assert(std::stoi(L"-10") == -10);
     assert(std::stoi(L" 10") == 10);
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         assert(std::stoi(L"10g", &idx, 16) == 16);
         assert(idx == 2);
     }
 #ifndef TEST_HAS_NO_EXCEPTIONS
     if (std::numeric_limits<long>::max() > std::numeric_limits<int>::max()) {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stoi(L"0x100000000", &idx, 16);
             assert(false);
@@ -88,7 +88,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stoi(L"", &idx);
             assert(false);
@@ -97,7 +97,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stoi(L"  - 8", &idx);
             assert(false);
@@ -106,7 +106,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stoi(L"a1", &idx);
             assert(false);

diff  --git a/libcxx/test/std/strings/string.conversions/stol.pass.cpp b/libcxx/test/std/strings/string.conversions/stol.pass.cpp
index 3f376933e4857..2356ae87a4e7f 100644
--- a/libcxx/test/std/strings/string.conversions/stol.pass.cpp
+++ b/libcxx/test/std/strings/string.conversions/stol.pass.cpp
@@ -24,13 +24,13 @@ int main(int, char**)
     assert(std::stol("-10") == -10);
     assert(std::stol(" 10") == 10);
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         assert(std::stol("10g", &idx, 16) == 16);
         assert(idx == 2);
     }
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stol("", &idx);
             assert(false);
@@ -39,7 +39,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stol("  - 8", &idx);
             assert(false);
@@ -48,7 +48,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stol("a1", &idx);
             assert(false);
@@ -57,7 +57,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             // LWG#2009 and PR14919
             (void)std::stol("9999999999999999999999999999999999999999999999999", &idx);
@@ -74,13 +74,13 @@ int main(int, char**)
     assert(std::stol(L"-10") == -10);
     assert(std::stol(L" 10") == 10);
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         assert(std::stol(L"10g", &idx, 16) == 16);
         assert(idx == 2);
     }
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stol(L"", &idx);
             assert(false);
@@ -89,7 +89,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stol(L"  - 8", &idx);
             assert(false);
@@ -98,7 +98,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stol(L"a1", &idx);
             assert(false);
@@ -107,7 +107,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             // LWG#2009 and PR14919
             (void)std::stol(L"9999999999999999999999999999999999999999999999999", &idx);

diff  --git a/libcxx/test/std/strings/string.conversions/stold.pass.cpp b/libcxx/test/std/strings/string.conversions/stold.pass.cpp
index abe8842fc6e09..dc9d3c607ae37 100644
--- a/libcxx/test/std/strings/string.conversions/stold.pass.cpp
+++ b/libcxx/test/std/strings/string.conversions/stold.pass.cpp
@@ -25,29 +25,29 @@ int main(int, char**)
     assert(std::stold("-10") == -10);
     assert(std::stold(" 10") == 10);
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         assert(std::stold("10g", &idx) == 10);
         assert(idx == 2);
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         assert(std::stold("1.e60", &idx) == 1.e60L);
         assert(idx == 5);
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         assert(std::stold("INF", &idx) == INFINITY);
         assert(idx == 3);
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         assert(std::isnan(std::stold("NAN", &idx)));
         assert(idx == 3);
     }
 
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stold("", &idx);
             assert(false);
@@ -56,7 +56,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stold("  - 8", &idx);
             assert(false);
@@ -65,7 +65,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stold("a1", &idx);
             assert(false);
@@ -74,7 +74,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             assert(std::stold("1.e6000", &idx) == INFINITY);
             assert(false);
@@ -90,28 +90,28 @@ int main(int, char**)
     assert(std::stold(L"-10.5") == -10.5);
     assert(std::stold(L" 10") == 10);
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         assert(std::stold(L"10g", &idx) == 10);
         assert(idx == 2);
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         assert(std::stold(L"1.e60", &idx) == 1.e60L);
         assert(idx == 5);
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         assert(std::stold(L"INF", &idx) == INFINITY);
         assert(idx == 3);
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         assert(std::isnan(std::stold(L"NAN", &idx)));
         assert(idx == 3);
     }
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stold(L"", &idx);
             assert(false);
@@ -120,7 +120,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stold(L"  - 8", &idx);
             assert(false);
@@ -129,7 +129,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stold(L"a1", &idx);
             assert(false);
@@ -138,7 +138,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             assert(std::stold(L"1.e6000", &idx) == INFINITY);
             assert(false);

diff  --git a/libcxx/test/std/strings/string.conversions/stoll.pass.cpp b/libcxx/test/std/strings/string.conversions/stoll.pass.cpp
index b8eb1b5c05fc2..fc6bd136cf4f3 100644
--- a/libcxx/test/std/strings/string.conversions/stoll.pass.cpp
+++ b/libcxx/test/std/strings/string.conversions/stoll.pass.cpp
@@ -24,13 +24,13 @@ int main(int, char**)
     assert(std::stoll("-10") == -10);
     assert(std::stoll(" 10") == 10);
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         assert(std::stoll("10g", &idx, 16) == 16);
         assert(idx == 2);
     }
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stoll("", &idx);
             assert(false);
@@ -39,7 +39,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stoll("  - 8", &idx);
             assert(false);
@@ -48,7 +48,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stoll("a1", &idx);
             assert(false);
@@ -57,7 +57,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             // LWG#2009 and PR14919
             (void)std::stoll("99999999999999999999999999", &idx);
@@ -74,13 +74,13 @@ int main(int, char**)
     assert(std::stoll(L"-10") == -10);
     assert(std::stoll(L" 10") == 10);
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         assert(std::stoll(L"10g", &idx, 16) == 16);
         assert(idx == 2);
     }
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stoll(L"", &idx);
             assert(false);
@@ -89,7 +89,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stoll(L"  - 8", &idx);
             assert(false);
@@ -98,7 +98,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stoll(L"a1", &idx);
             assert(false);
@@ -107,7 +107,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             // LWG#2009 and PR14919
             (void)std::stoll(L"99999999999999999999999999", &idx);

diff  --git a/libcxx/test/std/strings/string.conversions/stoul.pass.cpp b/libcxx/test/std/strings/string.conversions/stoul.pass.cpp
index b84891ecd2dcb..a8d23f92959aa 100644
--- a/libcxx/test/std/strings/string.conversions/stoul.pass.cpp
+++ b/libcxx/test/std/strings/string.conversions/stoul.pass.cpp
@@ -23,13 +23,13 @@ int main(int, char**)
     assert(std::stoul("-0") == 0);
     assert(std::stoul(" 10") == 10);
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         assert(std::stoul("10g", &idx, 16) == 16);
         assert(idx == 2);
     }
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stoul("", &idx);
             assert(false);
@@ -38,7 +38,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stoul("  - 8", &idx);
             assert(false);
@@ -47,7 +47,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stoul("a1", &idx);
             assert(false);
@@ -56,7 +56,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             // LWG#2009 and PR14919
             (void)std::stoul("9999999999999999999999999999999999999999999999999", &idx);
@@ -72,13 +72,13 @@ int main(int, char**)
     assert(std::stoul(L"-0") == 0);
     assert(std::stoul(L" 10") == 10);
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         assert(std::stoul(L"10g", &idx, 16) == 16);
         assert(idx == 2);
     }
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stoul(L"", &idx);
             assert(false);
@@ -87,7 +87,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stoul(L"  - 8", &idx);
             assert(false);
@@ -96,7 +96,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stoul(L"a1", &idx);
             assert(false);
@@ -105,7 +105,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             // LWG#2009 and PR14919
             (void)std::stoul(L"9999999999999999999999999999999999999999999999999", &idx);

diff  --git a/libcxx/test/std/strings/string.conversions/stoull.pass.cpp b/libcxx/test/std/strings/string.conversions/stoull.pass.cpp
index 744dcab28c4d5..2757cea130872 100644
--- a/libcxx/test/std/strings/string.conversions/stoull.pass.cpp
+++ b/libcxx/test/std/strings/string.conversions/stoull.pass.cpp
@@ -23,13 +23,13 @@ int main(int, char**)
     assert(std::stoull("-0") == 0);
     assert(std::stoull(" 10") == 10);
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         assert(std::stoull("10g", &idx, 16) == 16);
         assert(idx == 2);
     }
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stoull("", &idx);
             assert(false);
@@ -38,7 +38,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stoull("  - 8", &idx);
             assert(false);
@@ -47,7 +47,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stoull("a1", &idx);
             assert(false);
@@ -56,7 +56,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             // LWG#2009 and PR14919
             (void)std::stoull("9999999999999999999999999999999999999999999999999", &idx);
@@ -72,13 +72,13 @@ int main(int, char**)
     assert(std::stoull(L"-0") == 0);
     assert(std::stoull(L" 10") == 10);
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         assert(std::stoull(L"10g", &idx, 16) == 16);
         assert(idx == 2);
     }
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stoull(L"", &idx);
             assert(false);
@@ -87,7 +87,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stoull(L"  - 8", &idx);
             assert(false);
@@ -96,7 +96,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             (void)std::stoull(L"a1", &idx);
             assert(false);
@@ -105,7 +105,7 @@ int main(int, char**)
         }
     }
     {
-        size_t idx = 0;
+        std::size_t idx = 0;
         try {
             // LWG#2009 and PR14919
             (void)std::stoull(L"9999999999999999999999999999999999999999999999999", &idx);

diff  --git a/libcxx/test/std/strings/string.view/string.view.access/at.pass.cpp b/libcxx/test/std/strings/string.view/string.view.access/at.pass.cpp
index 99a81acdf32d3..c01017493f3e6 100644
--- a/libcxx/test/std/strings/string.view/string.view.access/at.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.access/at.pass.cpp
@@ -17,10 +17,10 @@
 #include "test_macros.h"
 
 template <typename CharT>
-void test ( const CharT *s, size_t len ) {
+void test ( const CharT *s, std::size_t len ) {
     std::basic_string_view<CharT> sv ( s, len );
     assert ( sv.length() == len );
-    for ( size_t i = 0; i < len; ++i ) {
+    for ( std::size_t i = 0; i < len; ++i ) {
         assert (  sv.at(i) == s[i] );
         assert ( &sv.at(i) == s + i );
     }

diff  --git a/libcxx/test/std/strings/string.view/string.view.access/back.pass.cpp b/libcxx/test/std/strings/string.view/string.view.access/back.pass.cpp
index 49b84ab1a6818..e63b80daeb032 100644
--- a/libcxx/test/std/strings/string.view/string.view.access/back.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.access/back.pass.cpp
@@ -18,7 +18,7 @@
 #include "test_macros.h"
 
 template <typename CharT>
-bool test ( const CharT *s, size_t len ) {
+bool test ( const CharT *s, std::size_t len ) {
     typedef std::basic_string_view<CharT> SV;
     SV sv ( s, len );
     ASSERT_SAME_TYPE(decltype(sv.back()), typename SV::const_reference);

diff  --git a/libcxx/test/std/strings/string.view/string.view.access/data.pass.cpp b/libcxx/test/std/strings/string.view/string.view.access/data.pass.cpp
index 50d2a14348a3e..bf5485b96826c 100644
--- a/libcxx/test/std/strings/string.view/string.view.access/data.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.access/data.pass.cpp
@@ -19,7 +19,7 @@
 #include "test_macros.h"
 
 template <typename CharT>
-void test ( const CharT *s, size_t len ) {
+void test ( const CharT *s, std::size_t len ) {
     std::basic_string_view<CharT> sv ( s, len );
     assert ( sv.length() == len );
     assert ( sv.data() == s );

diff  --git a/libcxx/test/std/strings/string.view/string.view.access/front.pass.cpp b/libcxx/test/std/strings/string.view/string.view.access/front.pass.cpp
index d9e1607643bca..72aa0258bbc04 100644
--- a/libcxx/test/std/strings/string.view/string.view.access/front.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.access/front.pass.cpp
@@ -18,7 +18,7 @@
 #include "test_macros.h"
 
 template <typename CharT>
-bool test ( const CharT *s, size_t len ) {
+bool test ( const CharT *s, std::size_t len ) {
     typedef std::basic_string_view<CharT> SV;
     SV sv ( s, len );
     ASSERT_SAME_TYPE(decltype(sv.front()), typename SV::const_reference);

diff  --git a/libcxx/test/std/strings/string.view/string.view.access/index.pass.cpp b/libcxx/test/std/strings/string.view/string.view.access/index.pass.cpp
index b27bc65251c57..51c60ec0057b8 100644
--- a/libcxx/test/std/strings/string.view/string.view.access/index.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.access/index.pass.cpp
@@ -18,13 +18,13 @@
 #include "test_macros.h"
 
 template <typename CharT>
-void test ( const CharT *s, size_t len ) {
+void test ( const CharT *s, std::size_t len ) {
     typedef std::basic_string_view<CharT> SV;
     SV sv ( s, len );
     ASSERT_SAME_TYPE(decltype(sv[0]), typename SV::const_reference);
     LIBCPP_ASSERT_NOEXCEPT(   sv[0]);
     assert ( sv.length() == len );
-    for ( size_t i = 0; i < len; ++i ) {
+    for ( std::size_t i = 0; i < len; ++i ) {
         assert ( sv[i] == s[i] );
         assert ( &sv[i] == s + i );
         }

diff  --git a/libcxx/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp b/libcxx/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp
index 2e11aa120d3d5..a9fd862d65548 100644
--- a/libcxx/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp
@@ -59,7 +59,7 @@ void test1 () {
 }
 
 template<typename CharT>
-void test2 ( const CharT *s, size_t len ) {
+void test2 ( const CharT *s, std::size_t len ) {
     {
     std::basic_string_view<CharT> sv1 ( s );
     assert ( sv1.size() == len );

diff  --git a/libcxx/test/std/strings/string.view/string.view.comparison/common_type_specialization.pass.cpp b/libcxx/test/std/strings/string.view/string.view.comparison/common_type_specialization.pass.cpp
index 248ef567bfa7f..ef120cbcff178 100644
--- a/libcxx/test/std/strings/string.view/string.view.comparison/common_type_specialization.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.comparison/common_type_specialization.pass.cpp
@@ -32,7 +32,7 @@ struct std::char_traits<char_wrapper> {
 
   static bool eq(char_wrapper lhs, char_wrapper rhs) { return lhs.c == rhs.c; }
 
-  static size_t length(const char_wrapper* a) {
+  static std::size_t length(const char_wrapper* a) {
     static_assert(sizeof(char_wrapper) == 1, "strlen requires this");
     return std::strlen(reinterpret_cast<const char*>(a));
   }

diff  --git a/libcxx/test/std/strings/string.view/string.view.comparison/comparison.pass.cpp b/libcxx/test/std/strings/string.view/string.view.comparison/comparison.pass.cpp
index 120b9a0b3f273..bf4ebd9258b53 100644
--- a/libcxx/test/std/strings/string.view/string.view.comparison/comparison.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.comparison/comparison.pass.cpp
@@ -47,7 +47,7 @@ struct char_traits {
   static constexpr void assign(char_type& __c1, const char_type& __c2) noexcept { __c1 = __c2; }
   static constexpr bool eq(char_type __c1, char_type __c2) noexcept { return __c1 == __c2; }
   static constexpr bool lt(char_type __c1, char_type __c2) noexcept { return __c1 < __c2; }
-  static constexpr int compare(const char_type* __s1, const char_type* __s2, size_t __n) {
+  static constexpr int compare(const char_type* __s1, const char_type* __s2, std::size_t __n) {
     for (; __n; --__n, ++__s1, ++__s2) {
       if (lt(*__s1, *__s2))
         return -1;
@@ -57,11 +57,11 @@ struct char_traits {
     return 0;
   }
 
-  static constexpr size_t length(const char_type* __s);
-  static constexpr const char_type* find(const char_type* __s, size_t __n, const char_type& __a);
-  static constexpr char_type* move(char_type* __s1, const char_type* __s2, size_t __n);
-  static constexpr char_type* copy(char_type* __s1, const char_type* __s2, size_t __n);
-  static constexpr char_type* assign(char_type* __s, size_t __n, char_type __a);
+  static constexpr std::size_t length(const char_type* __s);
+  static constexpr const char_type* find(const char_type* __s, std::size_t __n, const char_type& __a);
+  static constexpr char_type* move(char_type* __s1, const char_type* __s2, std::size_t __n);
+  static constexpr char_type* copy(char_type* __s1, const char_type* __s2, std::size_t __n);
+  static constexpr char_type* assign(char_type* __s, std::size_t __n, char_type __a);
   static constexpr int_type not_eof(int_type __c) noexcept { return eq_int_type(__c, eof()) ? ~eof() : __c; }
   static constexpr char_type to_char_type(int_type __c) noexcept { return char_type(__c); }
   static constexpr int_type to_int_type(char_type __c) noexcept { return int_type(__c); }
@@ -91,8 +91,8 @@ constexpr void test() {
   };
   static_assert(v.size() == vn.size());
 
-  for (size_t i = 0; i < v.size(); ++i) {
-    for (size_t j = 0; j < v.size(); ++j) {
+  for (std::size_t i = 0; i < v.size(); ++i) {
+    for (std::size_t j = 0; j < v.size(); ++j) {
       assert(testOrder(v[i], v[j], i == j ? Ordering::equivalent : i < j ? Ordering::less : Ordering::greater));
       assert(testOrder(
           v[i],

diff  --git a/libcxx/test/std/strings/string.view/string.view.comparison/comparison.verify.cpp b/libcxx/test/std/strings/string.view/string.view.comparison/comparison.verify.cpp
index 09bd1bd2cf77d..a2c58c3bbc159 100644
--- a/libcxx/test/std/strings/string.view/string.view.comparison/comparison.verify.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.comparison/comparison.verify.cpp
@@ -34,12 +34,12 @@ struct traits {
   static constexpr bool eq(char_type&, const char_type&) noexcept;
   static constexpr bool lt(char_type&, const char_type&) noexcept;
 
-  static constexpr int compare(const char_type*, const char_type*, size_t) { return 0; }
-  static constexpr size_t length(const char_type*);
-  static constexpr const char_type* find(const char_type*, size_t, const char_type&);
-  static constexpr char_type* move(char_type*, const char_type*, size_t);
-  static constexpr char_type* copy(char_type*, const char_type*, size_t);
-  static constexpr char_type* assign(char_type*, size_t, char_type);
+  static constexpr int compare(const char_type*, const char_type*, std::size_t) { return 0; }
+  static constexpr std::size_t length(const char_type*);
+  static constexpr const char_type* find(const char_type*, std::size_t, const char_type&);
+  static constexpr char_type* move(char_type*, const char_type*, std::size_t);
+  static constexpr char_type* copy(char_type*, const char_type*, std::size_t);
+  static constexpr char_type* assign(char_type*, std::size_t, char_type);
 
   static constexpr int_type not_eof(int_type) noexcept;
 

diff  --git a/libcxx/test/std/strings/string.view/string.view.cons/from_literal.pass.cpp b/libcxx/test/std/strings/string.view/string.view.cons/from_literal.pass.cpp
index 124aaeaab54a7..2f1e478d088cb 100644
--- a/libcxx/test/std/strings/string.view/string.view.cons/from_literal.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.cons/from_literal.pass.cpp
@@ -22,7 +22,7 @@
 
 template<typename CharT>
 size_t StrLen ( const CharT *s ) {
-    size_t retVal = 0;
+    std::size_t retVal = 0;
     while ( *s != 0 ) { ++retVal; ++s; }
     return retVal;
     }

diff  --git a/libcxx/test/std/strings/string.view/string.view.cons/from_ptr_len.pass.cpp b/libcxx/test/std/strings/string.view/string.view.cons/from_ptr_len.pass.cpp
index 8d48f90848119..8ff6061b48ecc 100644
--- a/libcxx/test/std/strings/string.view/string.view.cons/from_ptr_len.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.cons/from_ptr_len.pass.cpp
@@ -20,7 +20,7 @@
 #include "test_macros.h"
 
 template<typename CharT>
-void test ( const CharT *s, size_t sz ) {
+void test ( const CharT *s, std::size_t sz ) {
     {
     typedef std::basic_string_view<CharT> SV;
     LIBCPP_ASSERT_NOEXCEPT(SV(s, sz));

diff  --git a/libcxx/test/std/strings/string.view/string.view.cons/from_range.pass.cpp b/libcxx/test/std/strings/string.view/string.view.cons/from_range.pass.cpp
index 4ea963d925495..bf24d53aba890 100644
--- a/libcxx/test/std/strings/string.view/string.view.cons/from_range.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.cons/from_range.pass.cpp
@@ -163,7 +163,7 @@ void test_throwing() {
   struct ThrowingSize {
     char* begin() const { return nullptr; }
     char* end() const { return nullptr; }
-    size_t size() const { throw 42; return 0; }
+    std::size_t size() const { throw 42; return 0; }
   };
   try {
     ThrowingSize x;

diff  --git a/libcxx/test/std/strings/string.view/string.view.hash/char_type.hash.fail.cpp b/libcxx/test/std/strings/string.view/string.view.hash/char_type.hash.fail.cpp
index a1d6c10b64c84..c81b61b527e69 100644
--- a/libcxx/test/std/strings/string.view/string.view.hash/char_type.hash.fail.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.hash/char_type.hash.fail.cpp
@@ -33,14 +33,14 @@ struct trait // copied from <__string>
     static inline bool eq(char_type __c1, char_type __c2) { return __c1 == __c2; }
     static inline bool lt(char_type __c1, char_type __c2) { return __c1 < __c2; }
 
-    static int compare(const char_type* __s1, const char_type* __s2, size_t __n);
-    static size_t length(const char_type* __s);
-    static const char_type* find(const char_type* __s, size_t __n,
+    static int compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
+    static std::size_t length(const char_type* __s);
+    static const char_type* find(const char_type* __s, std::size_t __n,
                                  const char_type& __a);
 
-    static char_type* move(char_type* __s1, const char_type* __s2, size_t __n);
-    static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n);
-    static char_type* assign(char_type* __s, size_t __n, char_type __a);
+    static char_type* move(char_type* __s1, const char_type* __s2, std::size_t __n);
+    static char_type* copy(char_type* __s1, const char_type* __s2, std::size_t __n);
+    static char_type* assign(char_type* __s, std::size_t __n, char_type __a);
 
     static inline int_type not_eof(int_type __c) {
         return eq_int_type(__c, eof()) ? ~eof() : __c;

diff  --git a/libcxx/test/std/strings/string.view/string.view.hash/enabled_hashes.pass.cpp b/libcxx/test/std/strings/string.view/string.view.hash/enabled_hashes.pass.cpp
index 407823ba43258..f0fffbd32e7ae 100644
--- a/libcxx/test/std/strings/string.view/string.view.hash/enabled_hashes.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.hash/enabled_hashes.pass.cpp
@@ -36,12 +36,12 @@ struct std::char_traits<MyChar> {
   static bool eq(char_type, char_type);
   static bool lt(char_type, char_type);
 
-  static int              compare(const char_type*, const char_type*, size_t);
-  static size_t           length(const char_type*);
-  static const char_type* find(const char_type*, size_t, const char_type&);
-  static char_type*       move(char_type*, const char_type*, size_t);
-  static char_type*       copy(char_type*, const char_type*, size_t);
-  static char_type*       assign(char_type*, size_t, char_type);
+  static int              compare(const char_type*, const char_type*, std::size_t);
+  static std::size_t           length(const char_type*);
+  static const char_type* find(const char_type*, std::size_t, const char_type&);
+  static char_type*       move(char_type*, const char_type*, std::size_t);
+  static char_type*       copy(char_type*, const char_type*, std::size_t);
+  static char_type*       assign(char_type*, std::size_t, char_type);
 
   static int_type  not_eof(int_type);
   static char_type to_char_type(int_type);

diff  --git a/libcxx/test/std/strings/string.view/string.view.iterators/rbegin.pass.cpp b/libcxx/test/std/strings/string.view/string.view.iterators/rbegin.pass.cpp
index 9b96c0552519b..e5f0db5ffbf24 100644
--- a/libcxx/test/std/strings/string.view/string.view.iterators/rbegin.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.iterators/rbegin.pass.cpp
@@ -27,7 +27,7 @@ test(S s)
     typename S::const_reverse_iterator cb2 = s.crbegin();
     if (!s.empty())
     {
-        const size_t last = s.size() - 1;
+        const std::size_t last = s.size() - 1;
         assert(   *b ==  s[last]);
         assert(  &*b == &s[last]);
         assert( *cb1 ==  s[last]);

diff  --git a/libcxx/test/std/strings/string.view/string.view.modifiers/remove_prefix.pass.cpp b/libcxx/test/std/strings/string.view/string.view.modifiers/remove_prefix.pass.cpp
index bda42f0523075..4e41130a54b63 100644
--- a/libcxx/test/std/strings/string.view/string.view.modifiers/remove_prefix.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.modifiers/remove_prefix.pass.cpp
@@ -18,7 +18,7 @@
 #include "test_macros.h"
 
 template<typename CharT>
-void test ( const CharT *s, size_t len ) {
+void test ( const CharT *s, std::size_t len ) {
     typedef std::basic_string_view<CharT> SV;
     {
     SV sv1 ( s );
@@ -39,7 +39,7 @@ void test ( const CharT *s, size_t len ) {
 }
 
 #if TEST_STD_VER > 11
-constexpr size_t test_ce ( size_t n, size_t k ) {
+constexpr std::size_t test_ce ( size_t n, size_t k ) {
     typedef std::basic_string_view<char> SV;
     SV sv1{ "ABCDEFGHIJKL", n };
     sv1.remove_prefix ( k );

diff  --git a/libcxx/test/std/strings/string.view/string.view.modifiers/remove_suffix.pass.cpp b/libcxx/test/std/strings/string.view/string.view.modifiers/remove_suffix.pass.cpp
index 95a2331b61054..2ebe665c78f9e 100644
--- a/libcxx/test/std/strings/string.view/string.view.modifiers/remove_suffix.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.modifiers/remove_suffix.pass.cpp
@@ -18,7 +18,7 @@
 #include "test_macros.h"
 
 template<typename CharT>
-void test ( const CharT *s, size_t len ) {
+void test ( const CharT *s, std::size_t len ) {
     typedef std::basic_string_view<CharT> SV;
     {
     SV sv1 ( s );
@@ -40,7 +40,7 @@ void test ( const CharT *s, size_t len ) {
 }
 
 #if TEST_STD_VER > 11
-constexpr size_t test_ce ( size_t n, size_t k ) {
+constexpr std::size_t test_ce ( size_t n, size_t k ) {
     typedef std::basic_string_view<char> SV;
     SV sv1{ "ABCDEFGHIJKL", n };
     sv1.remove_suffix ( k );

diff  --git a/libcxx/test/std/strings/string.view/string.view.modifiers/swap.pass.cpp b/libcxx/test/std/strings/string.view/string.view.modifiers/swap.pass.cpp
index db229987b515b..7f46cbf15e7c1 100644
--- a/libcxx/test/std/strings/string.view/string.view.modifiers/swap.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.modifiers/swap.pass.cpp
@@ -18,7 +18,7 @@
 #include "test_macros.h"
 
 template<typename CharT>
-void test ( const CharT *s, size_t len ) {
+void test ( const CharT *s, std::size_t len ) {
     typedef std::basic_string_view<CharT> SV;
     {
     SV sv1(s);
@@ -37,7 +37,7 @@ void test ( const CharT *s, size_t len ) {
 }
 
 #if TEST_STD_VER > 11
-constexpr size_t test_ce ( size_t n, size_t k ) {
+constexpr std::size_t test_ce ( size_t n, size_t k ) {
     typedef std::basic_string_view<char> SV;
     SV sv1{ "ABCDEFGHIJKL", n };
     SV sv2 { sv1.data(), k };

diff  --git a/libcxx/test/std/strings/string.view/string.view.ops/compare.pointer_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.ops/compare.pointer_size.pass.cpp
index a7a5c30241814..b40ff6483ea6b 100644
--- a/libcxx/test/std/strings/string.view/string.view.ops/compare.pointer_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.ops/compare.pointer_size.pass.cpp
@@ -23,7 +23,7 @@ int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); }
 
 template<typename CharT>
 void test1 ( std::basic_string_view<CharT> sv1,
-             size_t pos1, size_t n1, const CharT *s, int expected ) {
+             std::size_t pos1, size_t n1, const CharT *s, int expected ) {
 #ifdef TEST_HAS_NO_EXCEPTIONS
     if (pos1 <= sv1.size())
         assert(sign(sv1.compare(pos1, n1, s)) == sign(expected));
@@ -40,7 +40,7 @@ void test1 ( std::basic_string_view<CharT> sv1,
 
 template<typename CharT>
 void
-test( const CharT *s1, size_t pos1, size_t n1, const CharT *s2, int expected)
+test( const CharT *s1, std::size_t pos1, size_t n1, const CharT *s2, int expected)
 {
     typedef std::basic_string_view<CharT> string_view_t;
     string_view_t sv1 ( s1 );
@@ -378,7 +378,7 @@ int main(int, char**)
     test("abcdefghijklmnopqrst", 5, 5, "", 20);
     test("abcdefghijklmnopqrst", 0, 8, "abcde", 15);
     test("abcdefghijklmnopqrst", 0, 12, "abcdefghij", 10);
-    test("abcdefghijklmnopqrst", 0, static_cast<size_t>(-1), "abcdefghijklmnopqrst", 0);
+    test("abcdefghijklmnopqrst", 0, static_cast<std::size_t>(-1), "abcdefghijklmnopqrst", 0);
     }
 
 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
@@ -398,7 +398,7 @@ int main(int, char**)
     test(L"abcdefghijklmnopqrst", 5, 5, L"", 20);
     test(L"abcdefghijklmnopqrst", 0, 8, L"abcde", 15);
     test(L"abcdefghijklmnopqrst", 0, 12, L"abcdefghij", 10);
-    test(L"abcdefghijklmnopqrst", 0, static_cast<size_t>(-1), L"abcdefghijklmnopqrst", 0);
+    test(L"abcdefghijklmnopqrst", 0, static_cast<std::size_t>(-1), L"abcdefghijklmnopqrst", 0);
     }
 #endif
 
@@ -419,7 +419,7 @@ int main(int, char**)
     test(U"abcdefghijklmnopqrst", 5, 5, U"", 20);
     test(U"abcdefghijklmnopqrst", 0, 8, U"abcde", 15);
     test(U"abcdefghijklmnopqrst", 0, 12, U"abcdefghij", 10);
-    test(U"abcdefghijklmnopqrst", 0, static_cast<size_t>(-1), U"abcdefghijklmnopqrst", 0);
+    test(U"abcdefghijklmnopqrst", 0, static_cast<std::size_t>(-1), U"abcdefghijklmnopqrst", 0);
     }
 
     {
@@ -438,7 +438,7 @@ int main(int, char**)
     test(u"abcdefghijklmnopqrst", 5, 5, u"", 20);
     test(u"abcdefghijklmnopqrst", 0, 8, u"abcde", 15);
     test(u"abcdefghijklmnopqrst", 0, 12, u"abcdefghij", 10);
-    test(u"abcdefghijklmnopqrst", 0, static_cast<size_t>(-1), u"abcdefghijklmnopqrst", 0);
+    test(u"abcdefghijklmnopqrst", 0, static_cast<std::size_t>(-1), u"abcdefghijklmnopqrst", 0);
     }
 #endif
 

diff  --git a/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv.pass.cpp b/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv.pass.cpp
index 477bfdde8c790..c1999d292882b 100644
--- a/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv.pass.cpp
@@ -22,7 +22,7 @@
 int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); }
 
 template<typename CharT>
-void test1 ( std::basic_string_view<CharT> sv1, size_t pos1, size_t n1,
+void test1 ( std::basic_string_view<CharT> sv1, std::size_t pos1, size_t n1,
             std::basic_string_view<CharT> sv2, int expected ) {
 #ifdef TEST_HAS_NO_EXCEPTIONS
     if (pos1 <= sv1.size())
@@ -40,7 +40,7 @@ void test1 ( std::basic_string_view<CharT> sv1, size_t pos1, size_t n1,
 
 
 template<typename CharT>
-void test ( const CharT *s1, size_t pos1, size_t n1, const CharT  *s2, int expected ) {
+void test ( const CharT *s1, std::size_t pos1, size_t n1, const CharT  *s2, int expected ) {
     typedef std::basic_string_view<CharT> string_view_t;
     string_view_t sv1 ( s1 );
     string_view_t sv2 ( s2 );

diff  --git a/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp
index f0c4a79e60837..4e5af15b9352f 100644
--- a/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp
@@ -23,8 +23,8 @@
 int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); }
 
 template<typename CharT>
-void test1 ( std::basic_string_view<CharT> sv1, size_t pos1, size_t n1,
-             const CharT *s2, size_t n2, int expected ) {
+void test1 ( std::basic_string_view<CharT> sv1, std::size_t pos1, size_t n1,
+             const CharT *s2, std::size_t n2, int expected ) {
 #ifdef TEST_HAS_NO_EXCEPTIONS
     if (pos1 <= sv1.size())
         assert(sign(sv1.compare(pos1, n1, s2, n2)) == sign(expected));
@@ -41,8 +41,8 @@ void test1 ( std::basic_string_view<CharT> sv1, size_t pos1, size_t n1,
 
 
 template<typename CharT>
-void test ( const CharT *s1, size_t pos1, size_t n1,
-            const CharT *s2, size_t n2,
+void test ( const CharT *s1, std::size_t pos1, size_t n1,
+            const CharT *s2, std::size_t n2,
             int expected ) {
     typedef std::basic_string_view<CharT> string_view_t;
     string_view_t sv1 ( s1 );

diff  --git a/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp
index a0f661c3520a6..a882372537503 100644
--- a/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp
@@ -23,8 +23,8 @@
 int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); }
 
 template<typename CharT>
-void test1 ( std::basic_string_view<CharT> sv1, size_t pos1, size_t n1,
-             std::basic_string_view<CharT> sv2, size_t pos2, size_t n2,
+void test1 ( std::basic_string_view<CharT> sv1, std::size_t pos1, size_t n1,
+             std::basic_string_view<CharT> sv2, std::size_t pos2, size_t n2,
              int expected ) {
 #ifdef TEST_HAS_NO_EXCEPTIONS
     if (pos1 <= sv1.size() && pos2 <= sv2.size())
@@ -42,8 +42,8 @@ void test1 ( std::basic_string_view<CharT> sv1, size_t pos1, size_t n1,
 
 
 template<typename CharT>
-void test ( const CharT *s1, size_t pos1, size_t n1,
-            const CharT *s2, size_t pos2, size_t n2,
+void test ( const CharT *s1, std::size_t pos1, size_t n1,
+            const CharT *s2, std::size_t pos2, size_t n2,
             int expected ) {
     typedef std::basic_string_view<CharT> string_view_t;
 

diff  --git a/libcxx/test/std/strings/string.view/string.view.ops/copy.pass.cpp b/libcxx/test/std/strings/string.view/string.view.ops/copy.pass.cpp
index 54e185f793c8f..0128e98ee6aa2 100644
--- a/libcxx/test/std/strings/string.view/string.view.ops/copy.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.ops/copy.pass.cpp
@@ -26,8 +26,8 @@
 #include "test_macros.h"
 
 template<typename CharT>
-void test1 ( std::basic_string_view<CharT> sv, size_t n, size_t pos ) {
-    const size_t rlen = std::min ( n, sv.size() - pos );
+void test1 ( std::basic_string_view<CharT> sv, std::size_t n, size_t pos ) {
+    const std::size_t rlen = std::min ( n, sv.size() - pos );
 
     CharT *dest1 = new CharT [rlen + 1];    dest1[rlen] = 0;
     CharT *dest2 = new CharT [rlen + 1];    dest2[rlen] = 0;
@@ -45,7 +45,7 @@ void test1 ( std::basic_string_view<CharT> sv, size_t n, size_t pos ) {
     } else {
         sv.copy(dest1, n, pos);
         std::copy_n(sv.begin() + pos, rlen, dest2);
-        for ( size_t i = 0; i <= rlen; ++i )
+        for ( std::size_t i = 0; i <= rlen; ++i )
             assert ( dest1[i] == dest2[i] );
     }
     delete [] dest1;

diff  --git a/libcxx/test/std/strings/string.view/string.view.ops/substr.pass.cpp b/libcxx/test/std/strings/string.view/string.view.ops/substr.pass.cpp
index 92f9d8cc8592c..0de64f0e59d49 100644
--- a/libcxx/test/std/strings/string.view/string.view.ops/substr.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.ops/substr.pass.cpp
@@ -24,7 +24,7 @@
 #include "test_macros.h"
 
 template<typename CharT>
-void test1(std::basic_string_view<CharT> sv, size_t n, size_t pos) {
+void test1(std::basic_string_view<CharT> sv, std::size_t n, size_t pos) {
     std::basic_string_view<CharT> sv1;
 #ifdef TEST_HAS_NO_EXCEPTIONS
     if (pos > sv.size())
@@ -40,9 +40,9 @@ void test1(std::basic_string_view<CharT> sv, size_t n, size_t pos) {
         return ;
     }
 #endif
-    const size_t rlen = std::min(n, sv.size() - pos);
+    const std::size_t rlen = std::min(n, sv.size() - pos);
     assert (sv1.size() == rlen);
-    for (size_t i = 0; i < rlen; ++i)
+    for (std::size_t i = 0; i < rlen; ++i)
         assert(sv[pos+i] == sv1[i]);
 }
 

diff  --git a/libcxx/test/std/strings/strings.erasure/erase.pass.cpp b/libcxx/test/std/strings/strings.erasure/erase.pass.cpp
index aa397ca68536b..ed7dc3cc5fbea 100644
--- a/libcxx/test/std/strings/strings.erasure/erase.pass.cpp
+++ b/libcxx/test/std/strings/strings.erasure/erase.pass.cpp
@@ -22,7 +22,7 @@
 #include "min_allocator.h"
 
 template <class S, class U>
-void test0(S s, U val, S expected, size_t expected_erased_count) {
+void test0(S s, U val, S expected, std::size_t expected_erased_count) {
   ASSERT_SAME_TYPE(typename S::size_type, decltype(std::erase(s, val)));
   assert(expected_erased_count == std::erase(s, val));
   LIBCPP_ASSERT(s.__invariants());

diff  --git a/libcxx/test/std/strings/strings.erasure/erase_if.pass.cpp b/libcxx/test/std/strings/strings.erasure/erase_if.pass.cpp
index 1957451bc64aa..b098f88208de8 100644
--- a/libcxx/test/std/strings/strings.erasure/erase_if.pass.cpp
+++ b/libcxx/test/std/strings/strings.erasure/erase_if.pass.cpp
@@ -21,7 +21,7 @@
 #include "min_allocator.h"
 
 template <class S, class Pred>
-void test0(S s, Pred p, S expected, size_t expected_erased_count) {
+void test0(S s, Pred p, S expected, std::size_t expected_erased_count) {
   ASSERT_SAME_TYPE(typename S::size_type, decltype(std::erase_if(s, p)));
   assert(expected_erased_count == std::erase_if(s, p));
   LIBCPP_ASSERT(s.__invariants());

diff  --git a/libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp b/libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp
index 38ff3d8f29a62..30ee9adcd74bf 100644
--- a/libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp
+++ b/libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp
@@ -49,10 +49,10 @@
 using namespace std;
 
 void initialize_randomness(mt19937_64& mt64, const int argc, char** const /*argv*/) {
-    constexpr size_t n = mt19937_64::state_size;
-    constexpr size_t w = mt19937_64::word_size;
+    constexpr std::size_t n = mt19937_64::state_size;
+    constexpr std::size_t w = mt19937_64::word_size;
     static_assert(w % 32 == 0);
-    constexpr size_t k = w / 32;
+    constexpr std::size_t k = w / 32;
 
     vector<std::uint32_t> vec(n * k);
 
@@ -70,7 +70,7 @@ void initialize_randomness(mt19937_64& mt64, const int argc, char** const /*argv
 
     puts("SEED DATA:");
     for (const auto& elem : vec) {
-        printf("%zu ", static_cast<size_t>(elem));
+        printf("%zu ", static_cast<std::size_t>(elem));
     }
     printf("\n");
 
@@ -103,14 +103,14 @@ void test_common_to_chars(
     // without attempting to write to extra chars even when they're available. Finally, we also verify that we aren't
     // underrunning the buffer. This is a concern because sometimes we walk backwards when rounding.
 
-    constexpr size_t BufferPrefix = 20; // detect buffer underruns (specific value isn't important)
+    constexpr std::size_t BufferPrefix = 20; // detect buffer underruns (specific value isn't important)
 
-    constexpr size_t Space = is_integral_v<T> ? 1 + 64 // worst case: -2^63 in binary
+    constexpr std::size_t Space = is_integral_v<T> ? 1 + 64 // worst case: -2^63 in binary
                            : is_same_v<T, float>
                                ? 1 + 151 // worst case: negative min subnormal float, fixed notation
                                : 1 + 1076; // worst case: negative min subnormal double, fixed notation
 
-    constexpr size_t BufferSuffix = 30; // detect buffer overruns (specific value isn't important)
+    constexpr std::size_t BufferSuffix = 30; // detect buffer overruns (specific value isn't important)
 
     array<char, BufferPrefix + Space + BufferSuffix> buff;
 
@@ -118,12 +118,12 @@ void test_common_to_chars(
     char* const first      = buff_begin + BufferPrefix;
     char* const buff_end   = buff_begin + buff.size();
 
-    constexpr size_t ExtraChars = 3;
+    constexpr std::size_t ExtraChars = 3;
     static_assert(ExtraChars + 10 < BufferSuffix,
         "The specific values aren't important, but there should be plenty of room to detect buffer overruns.");
 
-    for (size_t n = 0; n <= correct.size() + ExtraChars; ++n) {
-        assert(n <= static_cast<size_t>(buff_end - first));
+    for (std::size_t n = 0; n <= correct.size() + ExtraChars; ++n) {
+        assert(n <= static_cast<std::size_t>(buff_end - first));
         char* const last = first + n;
 
         buff.fill('@');
@@ -361,7 +361,7 @@ void test_integer_to_chars() {
 
         for (const auto& p : output_positive) {
             if (p.first <= static_cast<std::uint64_t>(numeric_limits<T>::max())) {
-                test_integer_to_chars(static_cast<T>(p.first), base, p.second[static_cast<size_t>(base)]);
+                test_integer_to_chars(static_cast<T>(p.first), base, p.second[static_cast<std::size_t>(base)]);
             }
         }
 
@@ -370,7 +370,7 @@ void test_integer_to_chars() {
 
             for (const auto& p : output_negative) {
                 if (p.first >= static_cast<std::int64_t>(numeric_limits<T>::min())) {
-                    test_integer_to_chars(static_cast<T>(p.first), base, p.second[static_cast<size_t>(base)]);
+                    test_integer_to_chars(static_cast<T>(p.first), base, p.second[static_cast<std::size_t>(base)]);
                 }
             }
         }
@@ -382,7 +382,7 @@ void test_integer_to_chars() {
 enum class TestFromCharsMode { Normal, SignalingNaN };
 
 template <typename T, typename BaseOrFmt>
-void test_from_chars(const string_view input, const BaseOrFmt base_or_fmt, const size_t correct_idx,
+void test_from_chars(const string_view input, const BaseOrFmt base_or_fmt, const std::size_t correct_idx,
     const errc correct_ec, const optional<T> opt_correct = nullopt,
     const TestFromCharsMode mode = TestFromCharsMode::Normal) {
 
@@ -545,7 +545,7 @@ void all_integer_tests() {
 
 void assert_message_bits(const bool b, const char* const msg, const std::uint32_t bits) {
     if (!b) {
-        fprintf(stderr, "%s failed for 0x%08zX\n", msg, static_cast<size_t>(bits));
+        fprintf(stderr, "%s failed for 0x%08zX\n", msg, static_cast<std::size_t>(bits));
         fprintf(stderr, "This is a randomized test.\n");
         fprintf(stderr, "DO NOT IGNORE/RERUN THIS FAILURE.\n");
         fprintf(stderr, "You must report it to the STL maintainers.\n");
@@ -587,7 +587,7 @@ void test_floating_prefix(const conditional_t<IsDouble, std::uint64_t, std::uint
     using FloatingType = conditional_t<IsDouble, double, float>;
 
     // "-1.2345678901234567e-100" or "-1.23456789e-10"
-    constexpr size_t buffer_size = IsDouble ? 24 : 15;
+    constexpr std::size_t buffer_size = IsDouble ? 24 : 15;
     char buffer[buffer_size];
 // TODO Enable once std::from_chars has floating point support.
 #if 0
@@ -600,11 +600,11 @@ void test_floating_prefix(const conditional_t<IsDouble, std::uint64_t, std::uint
     // 1 character for a negative sign
     // + 325 (for double; 46 for float) characters in the "0.000~~~000" prefix of the min subnormal
     // + 17 (for double; 9 for float) characters for round-trip digits
-    constexpr size_t fixed_buffer_size = IsDouble ? 1 + 325 + 17 : 1 + 46 + 9;
+    constexpr std::size_t fixed_buffer_size = IsDouble ? 1 + 325 + 17 : 1 + 46 + 9;
     char fixed_buffer[fixed_buffer_size];
 
     // worst case: negative sign + max normal + null terminator
-    constexpr size_t stdio_buffer_size = 1 + (IsDouble ? 309 : 39) + 1;
+    constexpr std::size_t stdio_buffer_size = 1 + (IsDouble ? 309 : 39) + 1;
     char stdio_buffer[stdio_buffer_size];
 
     for (std::uint32_t frac = 0; frac < Fractions; ++frac) {
@@ -630,7 +630,7 @@ void test_floating_prefix(const conditional_t<IsDouble, std::uint64_t, std::uint
             // Also verify that to_chars() and sprintf_s() emit the same output for integers in fixed notation.
             const auto fixed_result = to_chars(fixed_buffer, end(fixed_buffer), input, chars_format::fixed);
             assert_message_bits(fixed_result.ec == errc{}, "fixed_result.ec", bits);
-            const string_view fixed_sv(fixed_buffer, static_cast<size_t>(fixed_result.ptr - fixed_buffer));
+            const string_view fixed_sv(fixed_buffer, static_cast<std::size_t>(fixed_result.ptr - fixed_buffer));
 
             if (find(fixed_sv.begin(), fixed_sv.end(), '.') == fixed_sv.end()) {
                 const int stdio_ret = sprintf_s(stdio_buffer, size(stdio_buffer), "%.0f", input);
@@ -654,7 +654,7 @@ void test_floating_hex_prefix(const conditional_t<IsDouble, std::uint64_t, std::
     // float explicitly stores 23 fraction bits. 23 / 4 == 5.75, so we need 6 hexits.
 
     // "-1.fffffffffffffp+1023" or "-1.fffffep+127"
-    constexpr size_t buffer_size = IsDouble ? 22 : 14;
+    constexpr std::size_t buffer_size = IsDouble ? 22 : 14;
     char buffer[buffer_size];
 // TODO Enable once std::from_chars has floating point support.
 #if 0
@@ -693,18 +693,18 @@ void test_floating_precision_prefix(const conditional_t<IsDouble, std::uint64_t,
     constexpr int max_integer_length = IsDouble ? 309 : 39;
 
     // Size for fixed notation. (More than enough for scientific notation.)
-    constexpr size_t charconv_buffer_size = 1 // negative sign
+    constexpr std::size_t charconv_buffer_size = 1 // negative sign
                                           + max_integer_length // integer digits
                                           + 1 // decimal point
                                           + precision; // fractional digits
     char charconv_buffer[charconv_buffer_size];
 
-    constexpr size_t stdio_buffer_size = charconv_buffer_size + 1; // null terminator
+    constexpr std::size_t stdio_buffer_size = charconv_buffer_size + 1; // null terminator
     char stdio_buffer[stdio_buffer_size];
 
     // 1 character for a negative sign
     // + worst cases: 0x1.fffffffffffffp-1022 and 0x1.fffffep-126f
-    constexpr size_t general_buffer_size = 1 + (IsDouble ? 773 : 117);
+    constexpr std::size_t general_buffer_size = 1 + (IsDouble ? 773 : 117);
     char general_buffer[general_buffer_size];
     char general_stdio_buffer[general_buffer_size + 1]; // + null terminator
 
@@ -714,7 +714,7 @@ void test_floating_precision_prefix(const conditional_t<IsDouble, std::uint64_t,
 
         auto result = to_chars(charconv_buffer, end(charconv_buffer), input, chars_format::fixed, precision);
         assert_message_bits(result.ec == errc{}, "to_chars fixed precision", bits);
-        string_view charconv_sv(charconv_buffer, static_cast<size_t>(result.ptr - charconv_buffer));
+        string_view charconv_sv(charconv_buffer, static_cast<std::size_t>(result.ptr - charconv_buffer));
 
         int stdio_ret = sprintf_s(stdio_buffer, size(stdio_buffer), "%.*f", precision, input);
         assert_message_bits(stdio_ret != -1, "sprintf_s fixed precision", bits);
@@ -725,7 +725,7 @@ void test_floating_precision_prefix(const conditional_t<IsDouble, std::uint64_t,
 
         result = to_chars(charconv_buffer, end(charconv_buffer), input, chars_format::scientific, precision);
         assert_message_bits(result.ec == errc{}, "to_chars scientific precision", bits);
-        charconv_sv = string_view(charconv_buffer, static_cast<size_t>(result.ptr - charconv_buffer));
+        charconv_sv = string_view(charconv_buffer, static_cast<std::size_t>(result.ptr - charconv_buffer));
 
         stdio_ret = sprintf_s(stdio_buffer, size(stdio_buffer), "%.*e", precision, input);
         assert_message_bits(stdio_ret != -1, "sprintf_s scientific precision", bits);
@@ -736,7 +736,7 @@ void test_floating_precision_prefix(const conditional_t<IsDouble, std::uint64_t,
 
         result = to_chars(general_buffer, end(general_buffer), input, chars_format::general, 5000);
         assert_message_bits(result.ec == errc{}, "to_chars general precision", bits);
-        charconv_sv = string_view(general_buffer, static_cast<size_t>(result.ptr - general_buffer));
+        charconv_sv = string_view(general_buffer, static_cast<std::size_t>(result.ptr - general_buffer));
 
         stdio_ret = sprintf_s(general_stdio_buffer, size(general_stdio_buffer), "%.5000g", input);
         assert_message_bits(stdio_ret != -1, "sprintf_s general precision", bits);
@@ -1072,7 +1072,7 @@ int main(int argc, char** argv) {
     const long long ms = chrono::duration_cast<chrono::milliseconds>(finish - start).count();
 
     puts("PASS");
-    printf("Randomized test cases: %zu\n", static_cast<size_t>(PrefixesToTest * Fractions));
+    printf("Randomized test cases: %zu\n", static_cast<std::size_t>(PrefixesToTest * Fractions));
     printf("Total time: %lld ms\n", ms);
 
     if (ms < 3'000) {

diff  --git a/libcxx/test/std/utilities/charconv/charconv.msvc/test.hpp b/libcxx/test/std/utilities/charconv/charconv.msvc/test.hpp
index 3fdc0d31f8b19..eb6d6486333e9 100644
--- a/libcxx/test/std/utilities/charconv/charconv.msvc/test.hpp
+++ b/libcxx/test/std/utilities/charconv/charconv.msvc/test.hpp
@@ -21,7 +21,7 @@ inline constexpr double double_nan_payload = __builtin_nan("1729");
 struct FloatFromCharsTestCase {
     const char* input;
     chars_format fmt;
-    size_t correct_idx;
+    std::size_t correct_idx;
     errc correct_ec;
     float correct_value;
 };
@@ -42,7 +42,7 @@ struct FloatPrecisionToCharsTestCase {
 struct DoubleFromCharsTestCase {
     const char* input;
     chars_format fmt;
-    size_t correct_idx;
+    std::size_t correct_idx;
     errc correct_ec;
     double correct_value;
 };

diff  --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/arg.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/arg.pass.cpp
index 181c908aa5668..bb190c5ceee25 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/arg.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/arg.pass.cpp
@@ -32,7 +32,7 @@ void test() {
   const std::basic_format_context context = test_format_context_create(OutIt{output}, args);
   LIBCPP_ASSERT(args.__size() == 4);
   ASSERT_NOEXCEPT(context.arg(0));
-  for (size_t i = 0, e = args.__size(); i != e; ++i) {
+  for (std::size_t i = 0, e = args.__size(); i != e; ++i) {
     assert(context.arg(i));
   }
   assert(!context.arg(args.__size()));

diff  --git a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char_array.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char_array.pass.cpp
index 5c2b6dc32ac45..bb3299636e623 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char_array.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char_array.pass.cpp
@@ -34,14 +34,14 @@
 
 // This is based on the method found in
 // clang/test/CXX/temp/temp.arg/temp.arg.nontype/p1-cxx20.cpp
-template <size_t N>
+template <std::size_t N>
 struct Tester {
   // This is not part of the real test, but is used the deduce the size of the input.
   constexpr Tester(const char (&r)[N]) { __builtin_memcpy(text, r, N); }
   char text[N];
 
   // The size of the array shouldn't include the NUL character.
-  static const size_t size = N - 1;
+  static const std::size_t size = N - 1;
 
   template <class CharT>
   void test(const std::basic_string<CharT>& expected, const std::basic_string_view<CharT>& fmt) const {
@@ -82,7 +82,7 @@ struct Tester {
   }
 };
 
-template <size_t N>
+template <std::size_t N>
 Tester(const char (&)[N]) -> Tester<N>;
 
 template <Tester t, class CharT>

diff  --git a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.floating_point.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.floating_point.pass.cpp
index d74e1104d6a05..dc40acecc8a19 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.floating_point.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.floating_point.pass.cpp
@@ -87,7 +87,7 @@ void test_hex_lower_case_precision(ArithmeticT value) {
   char* end = std::to_chars(buffer.begin(), buffer.end(), value, std::chars_format::hex, 20'000).ptr;
   test_termination_condition(STR(".20000a}"), value, std::basic_string<CharT>{buffer.begin(), end});
 
-  size_t size = buffer.end() - end;
+  std::size_t size = buffer.end() - end;
   std::fill_n(end, size, '#');
   test_termination_condition(STR("#<25000.20000a}"), value, std::basic_string<CharT>{buffer.begin(), buffer.end()});
   std::rotate(buffer.begin(), buffer.end() - (size / 2), buffer.end());
@@ -127,7 +127,7 @@ void test_hex_upper_case_precision(ArithmeticT value) {
   std::transform(buffer.begin(), end, buffer.begin(), [](char c) { return std::toupper(c); });
   test_termination_condition(STR(".20000A}"), value, std::basic_string<CharT>{buffer.begin(), end});
 
-  size_t size = buffer.end() - end;
+  std::size_t size = buffer.end() - end;
   std::fill_n(end, size, '#');
   test_termination_condition(STR("#<25000.20000A}"), value, std::basic_string<CharT>{buffer.begin(), buffer.end()});
   std::rotate(buffer.begin(), buffer.end() - (size / 2), buffer.end());
@@ -167,7 +167,7 @@ void test_scientific_lower_case_precision(ArithmeticT value) {
   char* end = std::to_chars(buffer.begin(), buffer.end(), value, std::chars_format::scientific, 20'000).ptr;
   test_termination_condition(STR(".20000e}"), value, std::basic_string<CharT>{buffer.begin(), end});
 
-  size_t size = buffer.end() - end;
+  std::size_t size = buffer.end() - end;
   std::fill_n(end, size, '#');
   test_termination_condition(STR("#<25000.20000e}"), value, std::basic_string<CharT>{buffer.begin(), buffer.end()});
   std::rotate(buffer.begin(), buffer.end() - (size / 2), buffer.end());
@@ -207,7 +207,7 @@ void test_scientific_upper_case_precision(ArithmeticT value) {
   std::transform(buffer.begin(), end, buffer.begin(), [](char c) { return std::toupper(c); });
   test_termination_condition(STR(".20000E}"), value, std::basic_string<CharT>{buffer.begin(), end});
 
-  size_t size = buffer.end() - end;
+  std::size_t size = buffer.end() - end;
   std::fill_n(end, size, '#');
   test_termination_condition(STR("#<25000.20000E}"), value, std::basic_string<CharT>{buffer.begin(), buffer.end()});
   std::rotate(buffer.begin(), buffer.end() - (size / 2), buffer.end());
@@ -247,7 +247,7 @@ void test_fixed_lower_case_precision(ArithmeticT value) {
   char* end = std::to_chars(buffer.begin(), buffer.end(), value, std::chars_format::fixed, 20'000).ptr;
   test_termination_condition(STR(".20000f}"), value, std::basic_string<CharT>{buffer.begin(), end});
 
-  size_t size = buffer.end() - end;
+  std::size_t size = buffer.end() - end;
   std::fill_n(end, size, '#');
   test_termination_condition(STR("#<25000.20000f}"), value, std::basic_string<CharT>{buffer.begin(), buffer.end()});
   std::rotate(buffer.begin(), buffer.end() - (size / 2), buffer.end());
@@ -287,7 +287,7 @@ void test_fixed_upper_case_precision(ArithmeticT value) {
   std::transform(buffer.begin(), end, buffer.begin(), [](char c) { return std::toupper(c); });
   test_termination_condition(STR(".20000F}"), value, std::basic_string<CharT>{buffer.begin(), end});
 
-  size_t size = buffer.end() - end;
+  std::size_t size = buffer.end() - end;
   std::fill_n(end, size, '#');
   test_termination_condition(STR("#<25000.20000F}"), value, std::basic_string<CharT>{buffer.begin(), buffer.end()});
   std::rotate(buffer.begin(), buffer.end() - (size / 2), buffer.end());
@@ -327,7 +327,7 @@ void test_general_lower_case_precision(ArithmeticT value) {
   char* end = std::to_chars(buffer.begin(), buffer.end(), value, std::chars_format::general, 20'000).ptr;
   test_termination_condition(STR(".20000g}"), value, std::basic_string<CharT>{buffer.begin(), end});
 
-  size_t size = buffer.end() - end;
+  std::size_t size = buffer.end() - end;
   std::fill_n(end, size, '#');
   test_termination_condition(STR("#<25000.20000g}"), value, std::basic_string<CharT>{buffer.begin(), buffer.end()});
   std::rotate(buffer.begin(), buffer.end() - (size / 2), buffer.end());
@@ -367,7 +367,7 @@ void test_general_upper_case_precision(ArithmeticT value) {
   std::transform(buffer.begin(), end, buffer.begin(), [](char c) { return std::toupper(c); });
   test_termination_condition(STR(".20000G}"), value, std::basic_string<CharT>{buffer.begin(), end});
 
-  size_t size = buffer.end() - end;
+  std::size_t size = buffer.end() - end;
   std::fill_n(end, size, '#');
   test_termination_condition(STR("#<25000.20000G}"), value, std::basic_string<CharT>{buffer.begin(), buffer.end()});
   std::rotate(buffer.begin(), buffer.end() - (size / 2), buffer.end());

diff  --git a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.pass.cpp
index 030ce42927226..bc6b418862525 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.pass.cpp
@@ -26,7 +26,7 @@
 
 constexpr bool test() {
   std::format_parse_context context("", 10);
-  for (size_t i = 0; i < 10; ++i)
+  for (std::size_t i = 0; i < 10; ++i)
     context.check_arg_id(i);
 
   return true;
@@ -46,13 +46,13 @@ void test_exception() {
     assert(false);
   }();
 
-  auto test_arg = [](size_t num_args) {
+  auto test_arg = [](std::size_t num_args) {
     std::format_parse_context context("", num_args);
     // Out of bounds access is valid if !std::is_constant_evaluated()
-    for (size_t i = 0; i <= num_args; ++i)
+    for (std::size_t i = 0; i <= num_args; ++i)
       context.check_arg_id(i);
   };
-  for (size_t i = 0; i < 10; ++i)
+  for (std::size_t i = 0; i < 10; ++i)
     test_arg(i);
 }
 

diff  --git a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.pass.cpp
index 5ec3a943ba974..2d6de1f2f3354 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.pass.cpp
@@ -26,7 +26,7 @@
 
 constexpr bool test() {
   std::format_parse_context context("", 10);
-  for (size_t i = 0; i < 10; ++i)
+  for (std::size_t i = 0; i < 10; ++i)
     assert(i == context.next_arg_id());
 
   return true;

diff  --git a/libcxx/test/std/utilities/format/format.functions/escaped_output.ascii.pass.cpp b/libcxx/test/std/utilities/format/format.functions/escaped_output.ascii.pass.cpp
index d08133b98d250..a3184e4cba4a0 100644
--- a/libcxx/test/std/utilities/format/format.functions/escaped_output.ascii.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.functions/escaped_output.ascii.pass.cpp
@@ -91,12 +91,12 @@ auto test_formatted_size =
     []<class CharT, class... Args>(
         std::basic_string_view<CharT> expected, test_format_string<CharT, Args...> fmt, Args&&... args) {
       {
-        size_t size = std::formatted_size(fmt, std::forward<Args>(args)...);
+        std::size_t size = std::formatted_size(fmt, std::forward<Args>(args)...);
         assert(size == expected.size());
       }
 #ifndef TEST_HAS_NO_LOCALIZATION
       {
-        size_t size = std::formatted_size(std::locale(), fmt, std::forward<Args>(args)...);
+        std::size_t size = std::formatted_size(std::locale(), fmt, std::forward<Args>(args)...);
         assert(size == expected.size());
       }
 #endif // TEST_HAS_NO_LOCALIZATION
@@ -106,7 +106,7 @@ auto test_format_to_n =
     []<class CharT, class... Args>(
         std::basic_string_view<CharT> expected, test_format_string<CharT, Args...> fmt, Args&&... args) {
       {
-        size_t n = expected.size();
+        std::size_t n = expected.size();
         std::basic_string<CharT> out(n, CharT(' '));
         std::format_to_n_result result = std::format_to_n(out.begin(), n, fmt, std::forward<Args>(args)...);
         assert(result.size == static_cast<ptr
diff _t>(expected.size()));
@@ -115,7 +115,7 @@ auto test_format_to_n =
       }
 #ifndef TEST_HAS_NO_LOCALIZATION
       {
-        size_t n = expected.size();
+        std::size_t n = expected.size();
         std::basic_string<CharT> out(n, CharT(' '));
         std::format_to_n_result result =
             std::format_to_n(out.begin(), n, std::locale(), fmt, std::forward<Args>(args)...);

diff  --git a/libcxx/test/std/utilities/format/format.functions/escaped_output.unicode.pass.cpp b/libcxx/test/std/utilities/format/format.functions/escaped_output.unicode.pass.cpp
index 9caa3a22d7503..0cb0257b8ea57 100644
--- a/libcxx/test/std/utilities/format/format.functions/escaped_output.unicode.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.functions/escaped_output.unicode.pass.cpp
@@ -97,12 +97,12 @@ auto test_formatted_size =
     []<class CharT, class... Args>(
         std::basic_string_view<CharT> expected, test_format_string<CharT, Args...> fmt, Args&&... args) {
       {
-        size_t size = std::formatted_size(fmt, std::forward<Args>(args)...);
+        std::size_t size = std::formatted_size(fmt, std::forward<Args>(args)...);
         assert(size == expected.size());
       }
 #ifndef TEST_HAS_NO_LOCALIZATION
       {
-        size_t size = std::formatted_size(std::locale(), fmt, std::forward<Args>(args)...);
+        std::size_t size = std::formatted_size(std::locale(), fmt, std::forward<Args>(args)...);
         assert(size == expected.size());
       }
 #endif // TEST_HAS_NO_LOCALIZATION
@@ -112,7 +112,7 @@ auto test_format_to_n =
     []<class CharT, class... Args>(
         std::basic_string_view<CharT> expected, test_format_string<CharT, Args...> fmt, Args&&... args) {
       {
-        size_t n = expected.size();
+        std::size_t n = expected.size();
         std::basic_string<CharT> out(n, CharT(' '));
         std::format_to_n_result result = std::format_to_n(out.begin(), n, fmt, std::forward<Args>(args)...);
         assert(result.size == static_cast<ptr
diff _t>(expected.size()));
@@ -121,7 +121,7 @@ auto test_format_to_n =
       }
 #ifndef TEST_HAS_NO_LOCALIZATION
       {
-        size_t n = expected.size();
+        std::size_t n = expected.size();
         std::basic_string<CharT> out(n, CharT(' '));
         std::format_to_n_result result =
             std::format_to_n(out.begin(), n, std::locale(), fmt, std::forward<Args>(args)...);

diff  --git a/libcxx/test/std/utilities/format/format.functions/formatted_size.locale.pass.cpp b/libcxx/test/std/utilities/format/format.functions/formatted_size.locale.pass.cpp
index 625b99f0a8de1..7d41ddb81a00f 100644
--- a/libcxx/test/std/utilities/format/format.functions/formatted_size.locale.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.functions/formatted_size.locale.pass.cpp
@@ -32,7 +32,7 @@
 auto test =
     []<class CharT, class... Args>(
         std::basic_string_view<CharT> expected, test_format_string<CharT, Args...> fmt, Args&&... args) constexpr {
-      size_t size = std::formatted_size(std::locale(), fmt, std::forward<Args>(args)...);
+      std::size_t size = std::formatted_size(std::locale(), fmt, std::forward<Args>(args)...);
       assert(size == expected.size());
     };
 

diff  --git a/libcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp b/libcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp
index 6a627ec3fecfe..cd31da125c849 100644
--- a/libcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp
@@ -29,7 +29,7 @@
 auto test =
     []<class CharT, class... Args>(
         std::basic_string_view<CharT> expected, test_format_string<CharT, Args...> fmt, Args&&... args) constexpr {
-      size_t size = std::formatted_size(fmt, std::forward<Args>(args)...);
+      std::size_t size = std::formatted_size(fmt, std::forward<Args>(args)...);
       assert(size == expected.size());
     };
 

diff  --git a/libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp b/libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp
index c3ddef8fe7378..d5939e255423e 100644
--- a/libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp
@@ -165,7 +165,7 @@ void test(std::basic_string_view<CharT> expected, test_format_string<CharT, Args
   }
   // *** formatted_size ***
   {
-    size_t size = std::formatted_size(fmt, std::forward<Args>(args)...);
+    std::size_t size = std::formatted_size(fmt, std::forward<Args>(args)...);
     assert(size == expected.size());
   }
 }
@@ -215,7 +215,7 @@ void test(
   }
   // *** formatted_size ***
   {
-    size_t size = std::formatted_size(loc, fmt, std::forward<Args>(args)...);
+    std::size_t size = std::formatted_size(loc, fmt, std::forward<Args>(args)...);
     assert(size == expected.size());
   }
 }

diff  --git a/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp b/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp
index a7665f181ccd9..1704eb67562e1 100644
--- a/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp
@@ -39,7 +39,7 @@
 #include "test_iterators.h"
 
 template <typename T> struct MyHash {
-    size_t operator () (T t) const { return static_cast<size_t>(t); }
+    std::size_t operator () (T t) const { return static_cast<size_t>(t); }
 };
 
 template <typename Iter1, typename Iter2>

diff  --git a/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp b/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp
index c70782c8c78aa..3648be9bb06ac 100644
--- a/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp
@@ -39,7 +39,7 @@
 #include "test_iterators.h"
 
 template <typename T> struct MyHash {
-    size_t operator () (T t) const { return static_cast<size_t>(t); }
+    std::size_t operator () (T t) const { return static_cast<size_t>(t); }
 };
 
 struct count_equal

diff  --git a/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp b/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp
index 8ada7ef1d9e80..d0e6d5f8bfb6b 100644
--- a/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp
@@ -38,7 +38,7 @@
 #include "test_iterators.h"
 
 template <typename T> struct MyHash {
-    size_t operator () (T t) const { return static_cast<size_t>(t); }
+    std::size_t operator () (T t) const { return static_cast<size_t>(t); }
 };
 
 template <typename Iter1, typename Iter2>

diff  --git a/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp b/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp
index ec74f53850d1b..59b5b30d7f1b5 100644
--- a/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp
@@ -38,7 +38,7 @@
 #include "test_iterators.h"
 
 template <typename T> struct MyHash {
-    size_t operator () (T t) const { return static_cast<size_t>(t); }
+    std::size_t operator () (T t) const { return static_cast<size_t>(t); }
 };
 
 struct count_equal

diff  --git a/libcxx/test/std/utilities/function.objects/unord.hash/enum.compile.fail.cpp b/libcxx/test/std/utilities/function.objects/unord.hash/enum.compile.fail.cpp
index 2e36b4c55318a..4401bc1b6507f 100644
--- a/libcxx/test/std/utilities/function.objects/unord.hash/enum.compile.fail.cpp
+++ b/libcxx/test/std/utilities/function.objects/unord.hash/enum.compile.fail.cpp
@@ -19,7 +19,7 @@ struct X {};
 int main(int, char**)
 {
     X x;
-    size_t h = std::hash<X>{} ( x );
+    std::size_t h = std::hash<X>{} ( x );
 
   return 0;
 }

diff  --git a/libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp b/libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp
index 622a99cf0b4e8..c645ad8f476f1 100644
--- a/libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp
@@ -44,7 +44,7 @@ test()
         if (small)
         {
             const std::size_t result = h(t);
-            LIBCPP_ASSERT(result == static_cast<size_t>(t));
+            LIBCPP_ASSERT(result == static_cast<std::size_t>(t));
             ((void)result); // Prevent unused warning
         }
     }
@@ -72,7 +72,7 @@ int main(int, char**)
 
 //  LWG #2119
     test<std::ptr
diff _t>();
-    test<size_t>();
+    test<std::size_t>();
 
     test<std::int8_t>();
     test<std::int16_t>();

diff  --git a/libcxx/test/std/utilities/intseq/intseq.general/integer_seq.pass.cpp b/libcxx/test/std/utilities/intseq/intseq.general/integer_seq.pass.cpp
index f607da7f927b6..10a30dc4030ae 100644
--- a/libcxx/test/std/utilities/intseq/intseq.general/integer_seq.pass.cpp
+++ b/libcxx/test/std/utilities/intseq/intseq.general/integer_seq.pass.cpp
@@ -27,9 +27,9 @@ int main(int, char**)
 {
 //  Make a couple of sequences
     using int3    = std::make_integer_sequence<int, 3>;     // generates int:    0,1,2
-    using size7   = std::make_integer_sequence<size_t, 7>;  // generates size_t: 0,1,2,3,4,5,6
+    using size7   = std::make_integer_sequence<std::size_t, 7>;  // generates size_t: 0,1,2,3,4,5,6
     using size4   = std::make_index_sequence<4>;            // generates size_t: 0,1,2,3
-    using size2   = std::index_sequence_for<int, size_t>;   // generates size_t: 0,1
+    using size2   = std::index_sequence_for<int, std::size_t>;   // generates size_t: 0,1
     using intmix  = std::integer_sequence<int, 9, 8, 7, 2>; // generates int:    9,8,7,2
     using sizemix = std::index_sequence<1, 1, 2, 3, 5>;     // generates size_t: 1,1,2,3,5
 
@@ -37,19 +37,19 @@ int main(int, char**)
     static_assert ( std::is_same<int3::value_type, int>::value, "int3 type wrong" );
     static_assert ( int3::size () == 3, "int3 size wrong" );
 
-    static_assert ( std::is_same<size7::value_type, size_t>::value, "size7 type wrong" );
+    static_assert ( std::is_same<size7::value_type, std::size_t>::value, "size7 type wrong" );
     static_assert ( size7::size () == 7, "size7 size wrong" );
 
-    static_assert ( std::is_same<size4::value_type, size_t>::value, "size4 type wrong" );
+    static_assert ( std::is_same<size4::value_type, std::size_t>::value, "size4 type wrong" );
     static_assert ( size4::size () == 4, "size4 size wrong" );
 
-    static_assert ( std::is_same<size2::value_type, size_t>::value, "size2 type wrong" );
+    static_assert ( std::is_same<size2::value_type, std::size_t>::value, "size2 type wrong" );
     static_assert ( size2::size () == 2, "size2 size wrong" );
 
     static_assert ( std::is_same<intmix::value_type, int>::value, "intmix type wrong" );
     static_assert ( intmix::size () == 4, "intmix size wrong" );
 
-    static_assert ( std::is_same<sizemix::value_type, size_t>::value, "sizemix type wrong" );
+    static_assert ( std::is_same<sizemix::value_type, std::size_t>::value, "sizemix type wrong" );
     static_assert ( sizemix::size () == 5, "sizemix size wrong" );
 
     auto tup = std::make_tuple ( 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 );

diff  --git a/libcxx/test/std/utilities/memory/allocator.traits/allocate_at_least.pass.cpp b/libcxx/test/std/utilities/memory/allocator.traits/allocate_at_least.pass.cpp
index c8e23948bcfb8..ad9a2381cbfa1 100644
--- a/libcxx/test/std/utilities/memory/allocator.traits/allocate_at_least.pass.cpp
+++ b/libcxx/test/std/utilities/memory/allocator.traits/allocate_at_least.pass.cpp
@@ -27,8 +27,8 @@ struct no_allocate_at_least {
   using value_type = T;
   T t;
 
-  constexpr T* allocate(size_t) { return &t; }
-  constexpr void deallocate(T*, size_t) {}
+  constexpr T* allocate(std::size_t) { return &t; }
+  constexpr void deallocate(T*, std::size_t) {}
 };
 
 template <class T>
@@ -37,9 +37,9 @@ struct has_allocate_at_least {
   T t1;
   T t2;
 
-  constexpr T* allocate(size_t) { return &t1; }
-  constexpr void deallocate(T*, size_t) {}
-  constexpr std::allocation_result<T*> allocate_at_least(size_t) {
+  constexpr T* allocate(std::size_t) { return &t1; }
+  constexpr void deallocate(T*, std::size_t) {}
+  constexpr std::allocation_result<T*> allocate_at_least(std::size_t) {
     return {&t2, 2};
   }
 };

diff  --git a/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp b/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp
index 301078e515498..3ede16a08c178 100644
--- a/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp
+++ b/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp
@@ -36,7 +36,7 @@ struct B
 {
     typedef T value_type;
 
-    TEST_CONSTEXPR_CXX20 size_t max_size() const
+    TEST_CONSTEXPR_CXX20 std::size_t max_size() const
     {
         return 100;
     }

diff  --git a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.constexpr.size.verify.cpp b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.constexpr.size.verify.cpp
index 71db96807f55f..67ee2d8e33420 100644
--- a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.constexpr.size.verify.cpp
+++ b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.constexpr.size.verify.cpp
@@ -26,8 +26,8 @@ constexpr bool test()
     A a;
     TEST_IGNORE_NODISCARD a.allocate(AT::max_size(a) + 1);           // just barely too large
     TEST_IGNORE_NODISCARD a.allocate(AT::max_size(a) * 2);           // significantly too large
-    TEST_IGNORE_NODISCARD a.allocate(((size_t) -1) / sizeof(T) + 1); // multiply will overflow
-    TEST_IGNORE_NODISCARD a.allocate((size_t) -1);                   // way too large
+    TEST_IGNORE_NODISCARD a.allocate(((std::size_t) -1) / sizeof(T) + 1); // multiply will overflow
+    TEST_IGNORE_NODISCARD a.allocate((std::size_t) -1);                   // way too large
 
     return true;
 }

diff  --git a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp
index 49c7a0b3aad8d..244e9800d0a19 100644
--- a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp
+++ b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp
@@ -26,15 +26,15 @@ static const bool UsingAlignedNew = true;
 #endif
 
 #ifdef __STDCPP_DEFAULT_NEW_ALIGNMENT__
-static const size_t MaxAligned = __STDCPP_DEFAULT_NEW_ALIGNMENT__;
+static const std::size_t MaxAligned = __STDCPP_DEFAULT_NEW_ALIGNMENT__;
 #else
-static const size_t MaxAligned = std::alignment_of<std::max_align_t>::value;
+static const std::size_t MaxAligned = std::alignment_of<std::max_align_t>::value;
 #endif
 
-static const size_t OverAligned = MaxAligned * 2;
+static const std::size_t OverAligned = MaxAligned * 2;
 
 
-template <size_t Align>
+template <std::size_t Align>
 struct TEST_ALIGNAS(Align) AlignedType {
   char data;
   static int constructed;
@@ -42,11 +42,11 @@ struct TEST_ALIGNAS(Align) AlignedType {
   AlignedType(AlignedType const&) { ++constructed; }
   ~AlignedType() { --constructed; }
 };
-template <size_t Align>
+template <std::size_t Align>
 int AlignedType<Align>::constructed = 0;
 
 
-template <size_t Align>
+template <std::size_t Align>
 void test_aligned() {
   typedef AlignedType<Align> T;
   T::constructed = 0;
@@ -78,7 +78,7 @@ void test_aligned() {
 }
 
 #if TEST_STD_VER > 17
-template <size_t Align>
+template <std::size_t Align>
 constexpr bool test_aligned_constexpr() {
     typedef AlignedType<Align> T;
     std::allocator<T> a;

diff  --git a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp
index 3622b7c84adac..1913a0e0dcc8d 100644
--- a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp
+++ b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp
@@ -19,7 +19,7 @@
 #include "test_macros.h"
 
 template <typename T>
-void test_max(size_t count)
+void test_max(std::size_t count)
 {
     std::allocator<T> a;
     try {
@@ -38,8 +38,8 @@ void test()
     A a;
     test_max<T> (AT::max_size(a) + 1);             // just barely too large
     test_max<T> (AT::max_size(a) * 2);             // significantly too large
-    test_max<T> (((size_t) -1) / sizeof(T) + 1);   // multiply will overflow
-    test_max<T> ((size_t) -1);                     // way too large
+    test_max<T> (((std::size_t) -1) / sizeof(T) + 1);   // multiply will overflow
+    test_max<T> ((std::size_t) -1);                     // way too large
 }
 
 int main(int, char**)

diff  --git a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate_at_least.pass.cpp b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate_at_least.pass.cpp
index 6ac63a49d5015..05c66b065ef15 100644
--- a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate_at_least.pass.cpp
+++ b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate_at_least.pass.cpp
@@ -25,14 +25,14 @@ static const bool UsingAlignedNew = true;
 #endif
 
 #ifdef __STDCPP_DEFAULT_NEW_ALIGNMENT__
-static const size_t MaxAligned = __STDCPP_DEFAULT_NEW_ALIGNMENT__;
+static const std::size_t MaxAligned = __STDCPP_DEFAULT_NEW_ALIGNMENT__;
 #else
-static const size_t MaxAligned = std::alignment_of<std::max_align_t>::value;
+static const std::size_t MaxAligned = std::alignment_of<std::max_align_t>::value;
 #endif
 
-static const size_t OverAligned = MaxAligned * 2;
+static const std::size_t OverAligned = MaxAligned * 2;
 
-template <size_t Align>
+template <std::size_t Align>
 struct alignas(Align) AlignedType {
   char data;
   static int constructed;
@@ -40,11 +40,11 @@ struct alignas(Align) AlignedType {
   AlignedType(AlignedType const&) { ++constructed; }
   ~AlignedType() { --constructed; }
 };
-template <size_t Align>
+template <std::size_t Align>
 int AlignedType<Align>::constructed = 0;
 
 
-template <size_t Align>
+template <std::size_t Align>
 void test_aligned() {
   typedef AlignedType<Align> T;
   T::constructed = 0;
@@ -76,7 +76,7 @@ void test_aligned() {
   }
 }
 
-template <size_t Align>
+template <std::size_t Align>
 constexpr bool test_aligned_constexpr() {
     typedef AlignedType<Align> T;
     std::allocator<T> a;

diff  --git a/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/ranges_uninitialized_copy_n.pass.cpp b/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/ranges_uninitialized_copy_n.pass.cpp
index 013db78c876a9..097f88dec0022 100644
--- a/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/ranges_uninitialized_copy_n.pass.cpp
+++ b/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/ranges_uninitialized_copy_n.pass.cpp
@@ -33,9 +33,9 @@
 // libc++-specific.
 LIBCPP_STATIC_ASSERT(std::is_class_v<decltype(std::ranges::uninitialized_copy_n)>);
 
-static_assert(std::is_invocable_v<decltype(std::ranges::uninitialized_copy_n), int*, size_t, long*, long*>);
+static_assert(std::is_invocable_v<decltype(std::ranges::uninitialized_copy_n), int*, std::size_t, long*, long*>);
 struct NotConvertibleFromInt {};
-static_assert(!std::is_invocable_v<decltype(std::ranges::uninitialized_copy_n), int*, size_t, NotConvertibleFromInt*,
+static_assert(!std::is_invocable_v<decltype(std::ranges::uninitialized_copy_n), int*, std::size_t, NotConvertibleFromInt*,
                                    NotConvertibleFromInt*>);
 
 int main(int, char**) {

diff  --git a/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.fill.n/ranges_uninitialized_fill_n.pass.cpp b/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.fill.n/ranges_uninitialized_fill_n.pass.cpp
index a905507eef89d..0e8846e8c7c8f 100644
--- a/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.fill.n/ranges_uninitialized_fill_n.pass.cpp
+++ b/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.fill.n/ranges_uninitialized_fill_n.pass.cpp
@@ -33,7 +33,7 @@
 LIBCPP_STATIC_ASSERT(std::is_class_v<decltype(std::ranges::uninitialized_fill_n)>);
 
 struct NotConvertibleFromInt {};
-static_assert(!std::is_invocable_v<decltype(std::ranges::uninitialized_fill_n), NotConvertibleFromInt*, size_t, int>);
+static_assert(!std::is_invocable_v<decltype(std::ranges::uninitialized_fill_n), NotConvertibleFromInt*, std::size_t, int>);
 
 int main(int, char**) {
   constexpr int value = 42;

diff  --git a/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.move/ranges_uninitialized_move_n.pass.cpp b/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.move/ranges_uninitialized_move_n.pass.cpp
index 09bdcf4bf7b26..df79987920f4d 100644
--- a/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.move/ranges_uninitialized_move_n.pass.cpp
+++ b/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.move/ranges_uninitialized_move_n.pass.cpp
@@ -34,9 +34,9 @@
 // libc++-specific.
 LIBCPP_STATIC_ASSERT(std::is_class_v<decltype(std::ranges::uninitialized_move_n)>);
 
-static_assert(std::is_invocable_v<decltype(std::ranges::uninitialized_move_n), int*, size_t, long*, long*>);
+static_assert(std::is_invocable_v<decltype(std::ranges::uninitialized_move_n), int*, std::size_t, long*, long*>);
 struct NotConvertibleFromInt {};
-static_assert(!std::is_invocable_v<decltype(std::ranges::uninitialized_move_n), int*, size_t, NotConvertibleFromInt*,
+static_assert(!std::is_invocable_v<decltype(std::ranges::uninitialized_move_n), int*, std::size_t, NotConvertibleFromInt*,
                                    NotConvertibleFromInt*>);
 
 int main(int, char**) {

diff  --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp
index fc1500ff7f63e..707038e53ed10 100644
--- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp
+++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp
@@ -48,8 +48,8 @@ void test_disabled_with_deleter() {
 }
 
 template <class T>
-struct std::hash<min_pointer<T, std::integral_constant<size_t, 1>>> {
-  size_t operator()(min_pointer<T, std::integral_constant<size_t, 1>> p) const TEST_NOEXCEPT_FALSE {
+struct std::hash<min_pointer<T, std::integral_constant<std::size_t, 1>>> {
+  std::size_t operator()(min_pointer<T, std::integral_constant<size_t, 1>> p) const TEST_NOEXCEPT_FALSE {
     if (!p) return 0;
     return std::hash<T*>{}(std::addressof(*p));
   }

diff  --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared_construct.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared_construct.pass.cpp
index 3fa4ce7622c54..e354d4a2721d5 100644
--- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared_construct.pass.cpp
+++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared_construct.pass.cpp
@@ -122,7 +122,7 @@ struct Bar {
   std::max_align_t y;
 };
 
-void test_aligned(void* p, size_t align) {
+void test_aligned(void* p, std::size_t align) {
   assert(reinterpret_cast<uintptr_t>(p) % align == 0);
 }
 

diff  --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared_for_overwrite.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared_for_overwrite.pass.cpp
index 0027b0aa7c289..21e1786f01588 100644
--- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared_for_overwrite.pass.cpp
+++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared_for_overwrite.pass.cpp
@@ -40,21 +40,21 @@ static_assert(!HasMakeSharedForOverwrite<Foo, Foo>);
 
 // bounded array
 static_assert(HasMakeSharedForOverwrite<int[2]>);
-static_assert(!HasMakeSharedForOverwrite<int[2], size_t>);
+static_assert(!HasMakeSharedForOverwrite<int[2], std::size_t>);
 static_assert(!HasMakeSharedForOverwrite<int[2], int>);
 static_assert(!HasMakeSharedForOverwrite<int[2], int, int>);
 static_assert(HasMakeSharedForOverwrite<Foo[2]>);
-static_assert(!HasMakeSharedForOverwrite<Foo[2], size_t>);
+static_assert(!HasMakeSharedForOverwrite<Foo[2], std::size_t>);
 static_assert(!HasMakeSharedForOverwrite<Foo[2], int>);
 static_assert(!HasMakeSharedForOverwrite<Foo[2], int, int>);
 
 // unbounded array
-static_assert(HasMakeSharedForOverwrite<int[], size_t>);
-static_assert(HasMakeSharedForOverwrite<Foo[], size_t>);
+static_assert(HasMakeSharedForOverwrite<int[], std::size_t>);
+static_assert(HasMakeSharedForOverwrite<Foo[], std::size_t>);
 static_assert(!HasMakeSharedForOverwrite<int[]>);
 static_assert(!HasMakeSharedForOverwrite<Foo[]>);
-static_assert(!HasMakeSharedForOverwrite<int[], size_t, int>);
-static_assert(!HasMakeSharedForOverwrite<Foo[], size_t, int>);
+static_assert(!HasMakeSharedForOverwrite<int[], std::size_t, int>);
+static_assert(!HasMakeSharedForOverwrite<Foo[], std::size_t, int>);
 
 constexpr char pattern = 0xDE;
 

diff  --git a/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp b/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp
index 35d116065b075..51fe5dc332e91 100644
--- a/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp
+++ b/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp
@@ -274,7 +274,7 @@ int main(int, char**)
     static_assert(std::is_trivial<T1>::value, "");
     static_assert(std::is_standard_layout<T1>::value, "");
 #if TEST_STD_VER >= 11
-    const size_t alignment = TEST_ALIGNOF(std::max_align_t) > 16 ?
+    const std::size_t alignment = TEST_ALIGNOF(std::max_align_t) > 16 ?
         16 : TEST_ALIGNOF(std::max_align_t);
     static_assert(std::alignment_of<T1>::value == alignment, "");
 #else
@@ -292,7 +292,7 @@ int main(int, char**)
     static_assert(std::is_trivial<T1>::value, "");
     static_assert(std::is_standard_layout<T1>::value, "");
 #if TEST_STD_VER >= 11
-    const size_t alignment = TEST_ALIGNOF(std::max_align_t) > 16 ?
+    const std::size_t alignment = TEST_ALIGNOF(std::max_align_t) > 16 ?
         16 : TEST_ALIGNOF(std::max_align_t);
     static_assert(std::alignment_of<T1>::value == alignment, "");
     static_assert(sizeof(T1) == 16 + alignment, "");

diff  --git a/libcxx/test/std/utilities/optional/optional.hash/hash.pass.cpp b/libcxx/test/std/utilities/optional/optional.hash/hash.pass.cpp
index bb8a319316cdb..cb23e03e7ca70 100644
--- a/libcxx/test/std/utilities/optional/optional.hash/hash.pass.cpp
+++ b/libcxx/test/std/utilities/optional/optional.hash/hash.pass.cpp
@@ -27,7 +27,7 @@ namespace std {
 
 template <>
 struct hash<B> {
-  size_t operator()(B const&) noexcept(false) { return 0; }
+  std::size_t operator()(B const&) noexcept(false) { return 0; }
 };
 
 }

diff  --git a/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique_for_overwrite.pass.cpp b/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique_for_overwrite.pass.cpp
index 3f86904798fb8..06367fe51479f 100644
--- a/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique_for_overwrite.pass.cpp
+++ b/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique_for_overwrite.pass.cpp
@@ -42,21 +42,21 @@ static_assert(!HasMakeUniqueForOverwrite<Foo, Foo>);
 
 // template<class T>
 //   constexpr unique_ptr<T> make_unique_for_overwrite(size_t n);
-static_assert(HasMakeUniqueForOverwrite<int[], size_t>);
-static_assert(HasMakeUniqueForOverwrite<Foo[], size_t>);
+static_assert(HasMakeUniqueForOverwrite<int[], std::size_t>);
+static_assert(HasMakeUniqueForOverwrite<Foo[], std::size_t>);
 static_assert(!HasMakeUniqueForOverwrite<int[]>);
 static_assert(!HasMakeUniqueForOverwrite<Foo[]>);
-static_assert(!HasMakeUniqueForOverwrite<int[], size_t, int>);
-static_assert(!HasMakeUniqueForOverwrite<Foo[], size_t, int>);
+static_assert(!HasMakeUniqueForOverwrite<int[], std::size_t, int>);
+static_assert(!HasMakeUniqueForOverwrite<Foo[], std::size_t, int>);
 
 // template<class T, class... Args>
 //   unspecified make_unique_for_overwrite(Args&&...) = delete;
 static_assert(!HasMakeUniqueForOverwrite<int[2]>);
-static_assert(!HasMakeUniqueForOverwrite<int[2], size_t>);
+static_assert(!HasMakeUniqueForOverwrite<int[2], std::size_t>);
 static_assert(!HasMakeUniqueForOverwrite<int[2], int>);
 static_assert(!HasMakeUniqueForOverwrite<int[2], int, int>);
 static_assert(!HasMakeUniqueForOverwrite<Foo[2]>);
-static_assert(!HasMakeUniqueForOverwrite<Foo[2], size_t>);
+static_assert(!HasMakeUniqueForOverwrite<Foo[2], std::size_t>);
 static_assert(!HasMakeUniqueForOverwrite<Foo[2], int>);
 static_assert(!HasMakeUniqueForOverwrite<Foo[2], int, int>);
 
@@ -108,13 +108,13 @@ struct WithCustomNew {
   inline static bool customNewCalled    = false;
   inline static bool customNewArrCalled = false;
 
-  static void* operator new(size_t n) {
+  static void* operator new(std::size_t n) {
     customNewCalled = true;
     return ::operator new(n);
     ;
   }
 
-  static void* operator new[](size_t n) {
+  static void* operator new[](std::size_t n) {
     customNewArrCalled = true;
     return ::operator new[](n);
   }

diff  --git a/libcxx/test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp b/libcxx/test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp
index 522b9678d52db..2a80e2d48b322 100644
--- a/libcxx/test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp
+++ b/libcxx/test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp
@@ -76,7 +76,7 @@ TEST_CONSTEXPR_CXX23 void test_for_non_eager_instantiation() {
     // since it may not be well formed and can cause an error in the
     // non-immediate context.
     static_assert(!std::is_constructible<std::bitset<3>, Nonsense*>::value, "");
-    static_assert(!std::is_constructible<std::bitset<3>, Nonsense*, size_t, Nonsense&, Nonsense&>::value, "");
+    static_assert(!std::is_constructible<std::bitset<3>, Nonsense*, std::size_t, Nonsense&, Nonsense&>::value, "");
 }
 
 TEST_CONSTEXPR_CXX23 bool test() {

diff  --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp
index 5722044360140..e3a21149c21e4 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp
@@ -43,7 +43,7 @@ struct ConstructibleFromTuple<Tuple<Types...>> {
   TypeID const* arg_types;
 };
 
-template <class Tp, size_t N>
+template <class Tp, std::size_t N>
 struct ConstructibleFromTuple<std::array<Tp, N>> {
 template <class ...Args>
   explicit ConstructibleFromTuple(Args&&... xargs)

diff  --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/recursion_depth.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/recursion_depth.pass.cpp
index 339361acdf5b7..df10df84229f3 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/recursion_depth.pass.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/recursion_depth.pass.cpp
@@ -15,7 +15,7 @@
 #include <cassert>
 #include <utility>
 
-template <size_t... I>
+template <std::size_t... I>
 constexpr void CreateTuple(std::index_sequence<I...>) {
   std::tuple<decltype(I)...> tuple(I...);
   assert(std::get<0>(tuple) == 0);

diff  --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.array.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.array.pass.cpp
index 2236b6d1c29c6..c92ad4bf9834f 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.array.pass.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.array.pass.cpp
@@ -24,7 +24,7 @@
 
 #include "test_macros.h"
 
-template <class T, std::size_t N, class U, size_t idx>
+template <class T, std::size_t N, class U, std::size_t idx>
 void test()
 {
     static_assert((std::is_base_of<std::integral_constant<std::size_t, N>,

diff  --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.utility.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.utility.pass.cpp
index 458e4ffbc8c92..243f162fc70ec 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.utility.pass.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.utility.pass.cpp
@@ -23,7 +23,7 @@
 
 #include "test_macros.h"
 
-template <class T, std::size_t N, class U, size_t idx>
+template <class T, std::size_t N, class U, std::size_t idx>
 void test()
 {
     static_assert((std::is_base_of<std::integral_constant<std::size_t, N>,

diff  --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.fail.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.fail.cpp
index cde87e1208773..a2a65e0ebb8b5 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.fail.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.fail.cpp
@@ -27,7 +27,7 @@ struct Dummy3 {};
 template <>
 struct std::tuple_size<Dummy1> {
 public:
-  static size_t value;
+  static std::size_t value;
 };
 
 template <>

diff  --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.pass.cpp
index c0ec0cae5d57e..cb8d3e7bde512 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.pass.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.pass.cpp
@@ -22,7 +22,7 @@
 
 #include "test_macros.h"
 
-template <class T, size_t Size = sizeof(std::tuple_size<T>)>
+template <class T, std::size_t Size = sizeof(std::tuple_size<T>)>
 constexpr bool is_complete(int) { static_assert(Size > 0, ""); return true; }
 template <class> constexpr bool is_complete(long) { return false; }
 template <class T> constexpr bool is_complete() { return is_complete<T>(0); }
@@ -31,7 +31,7 @@ struct Dummy1 {};
 struct Dummy2 {};
 
 namespace std {
-template <> struct tuple_size<Dummy1> : public integral_constant<size_t, 0> {};
+template <> struct tuple_size<Dummy1> : public integral_constant<std::size_t, 0> {};
 }
 
 template <class T>

diff  --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp
index eb87e0b18c1d3..937d47a38792c 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp
@@ -113,7 +113,7 @@ struct Test {
   int x;
 };
 
-template <size_t N>
+template <std::size_t N>
 int get(Test const&) { static_assert(N == 0, ""); return -1; }
 
 template <>
@@ -130,7 +130,7 @@ void test_before_tuple_size_specialization() {
 template <>
 struct std::tuple_size<Test> {
 public:
-  static const size_t value = 1;
+  static const std::size_t value = 1;
 };
 
 void test_after_tuple_size_specialization() {

diff  --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate.pass.cpp
index ece7594e8ff2c..77e07dbefbc7b 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate.pass.cpp
@@ -29,7 +29,7 @@
 #include "test_macros.h"
 #include "test_std_memory_resource.h"
 
-template <size_t S, size_t Align>
+template <std::size_t S, size_t Align>
 void testForSizeAndAlign() {
   struct T {
     alignas(Align) std::byte buf[S];
@@ -48,7 +48,7 @@ void testForSizeAndAlign() {
 }
 
 #ifndef TEST_HAS_NO_EXCEPTIONS
-template <size_t S>
+template <std::size_t S>
 void testAllocForSizeThrows() {
   struct T {
     std::byte buf[S];
@@ -60,8 +60,8 @@ void testAllocForSizeThrows() {
   Alloc a(&R);
 
   // Test that allocating exactly the max size does not throw.
-  size_t maxSize = Traits::max_size(a);
-  size_t sizeTypeMax = std::numeric_limits<std::size_t>::max();
+  std::size_t maxSize = Traits::max_size(a);
+  std::size_t sizeTypeMax = std::numeric_limits<std::size_t>::max();
   if (maxSize != sizeTypeMax) {
     // Test that allocating size_t(~0) throws bad alloc.
     try {
@@ -71,7 +71,7 @@ void testAllocForSizeThrows() {
     }
 
     // Test that allocating even one more than the max size does throw.
-    size_t overSize = maxSize + 1;
+    std::size_t overSize = maxSize + 1;
     try {
       (void)a.allocate(overSize);
       assert(false);

diff  --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_bytes.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_bytes.pass.cpp
index a4db295f9ac32..0f5e2f0ae29ad 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_bytes.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_bytes.pass.cpp
@@ -27,8 +27,8 @@
 
 template <class T>
 void test() {
-  size_t last_size      = 0;
-  size_t last_alignment = 0;
+  std::size_t last_size      = 0;
+  std::size_t last_alignment = 0;
   TrackingMemRes resource(&last_size, &last_alignment);
 
   std::pmr::polymorphic_allocator<T> allocator(&resource);

diff  --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_object.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_object.pass.cpp
index b061afbbae0f1..5321554cb3a19 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_object.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_object.pass.cpp
@@ -27,8 +27,8 @@
 
 template <class T>
 void test() {
-  size_t last_size      = 0;
-  size_t last_alignment = 0;
+  std::size_t last_size      = 0;
+  std::size_t last_alignment = 0;
   TrackingMemRes resource(&last_size, &last_alignment);
 
   std::pmr::polymorphic_allocator<T> allocator(&resource);

diff  --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/deallocate.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/deallocate.pass.cpp
index e7884c9b079fe..5ead89bfa8b1d 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/deallocate.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/deallocate.pass.cpp
@@ -26,7 +26,7 @@
 #include "test_macros.h"
 #include "test_std_memory_resource.h"
 
-template <size_t S, size_t Align>
+template <std::size_t S, size_t Align>
 void testForSizeAndAlign() {
   struct T {
     alignas(Align) std::byte buf[S];

diff  --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/new_delete_object.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/new_delete_object.pass.cpp
index 463a8157e7233..a149486542bd1 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/new_delete_object.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/new_delete_object.pass.cpp
@@ -27,8 +27,8 @@
 
 template <class T>
 void test() {
-  size_t last_size      = 0;
-  size_t last_alignment = 0;
+  std::size_t last_size      = 0;
+  std::size_t last_alignment = 0;
   TrackingMemRes resource(&last_size, &last_alignment);
 
   std::pmr::polymorphic_allocator<T> allocator(&resource);

diff  --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/tracking_mem_res.h b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/tracking_mem_res.h
index d0b9eab578092..e78d9881eb457 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/tracking_mem_res.h
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/tracking_mem_res.h
@@ -9,23 +9,24 @@
 #ifndef TRACKING_MEM_RES_H
 #define TRACKING_MEM_RES_H
 
+#include <cstddef>
 #include <memory_resource>
 
 class TrackingMemRes : public std::pmr::memory_resource {
 public:
-  TrackingMemRes(size_t* last_size, size_t* last_alginment) : last_size_(last_size), last_alginment_(last_alginment) {}
+  TrackingMemRes(std::size_t* last_size, size_t* last_alginment) : last_size_(last_size), last_alginment_(last_alginment) {}
 
 private:
-  size_t* last_size_;
-  size_t* last_alginment_;
-  void* do_allocate(size_t size, size_t alignment) override {
+  std::size_t* last_size_;
+  std::size_t* last_alginment_;
+  void* do_allocate(std::size_t size, size_t alignment) override {
     *last_size_      = size;
     *last_alginment_ = alignment;
 
     return std::pmr::new_delete_resource()->allocate(size, alignment);
   }
 
-  void do_deallocate(void* ptr, size_t size, size_t alignment) override {
+  void do_deallocate(void* ptr, std::size_t size, size_t alignment) override {
     *last_size_      = size;
     *last_alginment_ = alignment;
     std::pmr::new_delete_resource()->deallocate(ptr, size, alignment);

diff  --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.global/new_delete_resource.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.global/new_delete_resource.pass.cpp
index bd8b8e9175c8c..abfeeef7058cf 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.global/new_delete_resource.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.global/new_delete_resource.pass.cpp
@@ -22,12 +22,12 @@
 #include "test_macros.h"
 
 class assert_on_compare : public std::pmr::memory_resource {
-  void* do_allocate(size_t, size_t) override {
+  void* do_allocate(std::size_t, size_t) override {
     assert(false);
     return nullptr;
   }
 
-  void do_deallocate(void*, size_t, size_t) override { assert(false); }
+  void do_deallocate(void*, std::size_t, size_t) override { assert(false); }
 
   bool do_is_equal(const std::pmr::memory_resource&) const noexcept override {
     assert(false);

diff  --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.global/null_memory_resource.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.global/null_memory_resource.pass.cpp
index fdaa398cbf6ae..097794f00f9e6 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.global/null_memory_resource.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.global/null_memory_resource.pass.cpp
@@ -24,12 +24,12 @@
 #include "test_macros.h"
 
 struct assert_on_compare : public std::pmr::memory_resource {
-  void* do_allocate(size_t, size_t) override {
+  void* do_allocate(std::size_t, size_t) override {
     assert(false);
     return nullptr;
   }
 
-  void do_deallocate(void*, size_t, size_t) override { assert(false); }
+  void do_deallocate(void*, std::size_t, size_t) override { assert(false); }
 
   bool do_is_equal(const std::pmr::memory_resource&) const noexcept override {
     assert(false);

diff  --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_exception_safety.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_exception_safety.pass.cpp
index d8f8dac433c79..e5cc4afc61520 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_exception_safety.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_exception_safety.pass.cpp
@@ -27,9 +27,9 @@ struct repointable_resource : public std::pmr::memory_resource {
   explicit repointable_resource(std::pmr::memory_resource* res) : which(res) {}
 
 private:
-  void* do_allocate(size_t size, size_t align) override { return which->allocate(size, align); }
+  void* do_allocate(std::size_t size, size_t align) override { return which->allocate(size, align); }
 
-  void do_deallocate(void* p, size_t size, size_t align) override { return which->deallocate(p, size, align); }
+  void do_deallocate(void* p, std::size_t size, size_t align) override { return which->deallocate(p, size, align); }
 
   bool do_is_equal(std::pmr::memory_resource const& rhs) const noexcept override { return which->is_equal(rhs); }
 };
@@ -49,7 +49,7 @@ void test_exception_safety() {
   assert(res != buffer);
   assert(globalMemCounter.checkNewCalledEq(1));
   assert(globalMemCounter.checkDeleteCalledEq(0));
-  const size_t last_new_size = globalMemCounter.last_new_size;
+  const std::size_t last_new_size = globalMemCounter.last_new_size;
 
   upstream.which = std::pmr::null_memory_resource();
   try {

diff  --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_in_geometric_progression.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_in_geometric_progression.pass.cpp
index ffe17d13a8233..f28aabb7f6430 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_in_geometric_progression.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_in_geometric_progression.pass.cpp
@@ -30,7 +30,7 @@ void test_geometric_progression() {
   std::pmr::memory_resource& r1 = mono1;
 
   assert(globalMemCounter.checkNewCalledEq(0));
-  size_t next_buffer_size = 100;
+  std::size_t next_buffer_size = 100;
   void* ret               = r1.allocate(10, 1);
   assert(ret != nullptr);
   assert(globalMemCounter.checkNewCalledEq(1));

diff  --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_overaligned_request.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_overaligned_request.pass.cpp
index d2b8454ae30c2..c16789a4558ea 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_overaligned_request.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_overaligned_request.pass.cpp
@@ -25,7 +25,7 @@ int main(int, char**) {
   auto mono1                    = std::pmr::monotonic_buffer_resource(1024, std::pmr::new_delete_resource());
   std::pmr::memory_resource& r1 = mono1;
 
-  constexpr size_t big_alignment = 8 * alignof(std::max_align_t);
+  constexpr std::size_t big_alignment = 8 * alignof(std::max_align_t);
   static_assert(big_alignment > 4);
 
   void* ret = r1.allocate(2048, big_alignment);

diff  --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_with_initial_size.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_with_initial_size.pass.cpp
index 15b3336c9b783..d764c90300d82 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_with_initial_size.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_with_initial_size.pass.cpp
@@ -20,7 +20,7 @@
 #include "count_new.h"
 #include "test_macros.h"
 
-void test(size_t initial_buffer_size) {
+void test(std::size_t initial_buffer_size) {
   globalMemCounter.reset();
 
   auto mono1 = std::pmr::monotonic_buffer_resource(initial_buffer_size, std::pmr::new_delete_resource());

diff  --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/equality.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/equality.pass.cpp
index 426331056af68..a218ac9bdcf10 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/equality.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/equality.pass.cpp
@@ -19,12 +19,12 @@
 #include <cstddef> // size_t
 
 struct assert_on_compare : public std::pmr::memory_resource {
-  void* do_allocate(size_t, size_t) override {
+  void* do_allocate(std::size_t, size_t) override {
     assert(false);
     return nullptr;
   }
 
-  void do_deallocate(void*, size_t, size_t) override { assert(false); }
+  void do_deallocate(void*, std::size_t, size_t) override { assert(false); }
 
   bool do_is_equal(const std::pmr::memory_resource&) const noexcept override {
     assert(false);

diff  --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/equality.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/equality.pass.cpp
index 39f0a11d6ac5e..d0099ca24b392 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/equality.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/equality.pass.cpp
@@ -23,12 +23,12 @@
 #include "count_new.h"
 
 class assert_on_compare : public std::pmr::memory_resource {
-  void* do_allocate(size_t, size_t) override {
+  void* do_allocate(std::size_t, size_t) override {
     assert(false);
     return nullptr;
   }
 
-  void do_deallocate(void*, size_t, size_t) override { assert(false); }
+  void do_deallocate(void*, std::size_t, size_t) override { assert(false); }
 
   bool do_is_equal(const std::pmr::memory_resource&) const noexcept override {
     assert(false);

diff  --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_overaligned_request.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_overaligned_request.pass.cpp
index d962d7f3d978b..c62723fd79735 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_overaligned_request.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_overaligned_request.pass.cpp
@@ -21,9 +21,9 @@
 #include "count_new.h"
 #include "test_macros.h"
 
-bool is_aligned_to(void* p, size_t alignment) {
+bool is_aligned_to(void* p, std::size_t alignment) {
   void* p2     = p;
-  size_t space = 1;
+  std::size_t space = 1;
   void* result = std::align(alignment, 1, p2, space);
   return (result == p);
 }
@@ -34,7 +34,7 @@ int main(int, char**) {
   std::pmr::synchronized_pool_resource sync1(opts, std::pmr::new_delete_resource());
   std::pmr::memory_resource& r1 = sync1;
 
-  constexpr size_t big_alignment = 8 * alignof(std::max_align_t);
+  constexpr std::size_t big_alignment = 8 * alignof(std::max_align_t);
   static_assert(big_alignment > 4);
 
   assert(globalMemCounter.checkNewCalledEq(0));

diff  --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_reuse_blocks.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_reuse_blocks.pass.cpp
index 1fbc2b0e3fc87..7e694df44a07a 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_reuse_blocks.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_reuse_blocks.pass.cpp
@@ -21,9 +21,9 @@
 #include "count_new.h"
 #include "test_macros.h"
 
-static bool is_aligned_to(void* p, size_t alignment) {
+static bool is_aligned_to(void* p, std::size_t alignment) {
   void* p2     = p;
-  size_t space = 1;
+  std::size_t space = 1;
   void* result = std::align(alignment, 1, p2, space);
   return (result == p);
 }

diff  --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_deallocate_matches_allocate.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_deallocate_matches_allocate.pass.cpp
index 26101d8e71c28..13595a66b45a9 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_deallocate_matches_allocate.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_deallocate_matches_allocate.pass.cpp
@@ -22,9 +22,9 @@
 #include <vector>
 
 struct allocation_record {
-  size_t bytes;
-  size_t align;
-  explicit allocation_record(size_t b, size_t a) : bytes(b), align(a) {}
+  std::size_t bytes;
+  std::size_t align;
+  explicit allocation_record(std::size_t b, size_t a) : bytes(b), align(a) {}
   bool operator==(const allocation_record& rhs) const { return (bytes == rhs.bytes) && (align == rhs.align); }
   bool operator<(const allocation_record& rhs) const {
     if (bytes != rhs.bytes)
@@ -34,12 +34,12 @@ struct allocation_record {
 };
 
 class test_resource : public std::pmr::memory_resource {
-  void* do_allocate(size_t bytes, size_t align) override {
+  void* do_allocate(std::size_t bytes, size_t align) override {
     void* result = std::pmr::new_delete_resource()->allocate(bytes, align);
     successful_allocations.emplace_back(bytes, align);
     return result;
   }
-  void do_deallocate(void* p, size_t bytes, size_t align) override {
+  void do_deallocate(void* p, std::size_t bytes, size_t align) override {
     deallocations.emplace_back(bytes, align);
     return std::pmr::new_delete_resource()->deallocate(p, bytes, align);
   }
@@ -70,7 +70,7 @@ void test_allocation_pattern(F do_pattern) {
       tr.deallocations.end()));
 }
 
-template <size_t Bytes, size_t Align>
+template <std::size_t Bytes, size_t Align>
 auto foo() {
   return [=](auto& mr) {
     void* p = mr.allocate(Bytes, Align);

diff  --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_overaligned_request.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_overaligned_request.pass.cpp
index a316750231724..445396bac32dd 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_overaligned_request.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_overaligned_request.pass.cpp
@@ -21,9 +21,9 @@
 #include "count_new.h"
 #include "test_macros.h"
 
-bool is_aligned_to(void* p, size_t alignment) {
+bool is_aligned_to(void* p, std::size_t alignment) {
   void* p2     = p;
-  size_t space = 1;
+  std::size_t space = 1;
   void* result = std::align(alignment, 1, p2, space);
   return (result == p);
 }
@@ -34,7 +34,7 @@ int main(int, char**) {
   auto unsync1                  = std::pmr::unsynchronized_pool_resource(opts, std::pmr::new_delete_resource());
   std::pmr::memory_resource& r1 = unsync1;
 
-  constexpr size_t big_alignment = 8 * alignof(std::max_align_t);
+  constexpr std::size_t big_alignment = 8 * alignof(std::max_align_t);
   static_assert(big_alignment > 4);
 
   assert(globalMemCounter.checkNewCalledEq(0));

diff  --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_reuse_blocks.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_reuse_blocks.pass.cpp
index 72087e88d78e6..f807acfa48652 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_reuse_blocks.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_reuse_blocks.pass.cpp
@@ -21,9 +21,9 @@
 #include "count_new.h"
 #include "test_macros.h"
 
-static bool is_aligned_to(void* p, size_t alignment) {
+static bool is_aligned_to(void* p, std::size_t alignment) {
   void* p2     = p;
-  size_t space = 1;
+  std::size_t space = 1;
   void* result = std::align(alignment, 1, p2, space);
   return (result == p);
 }

diff  --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_deallocate_matches_allocate.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_deallocate_matches_allocate.pass.cpp
index 2863cba6dd94b..65c441858d146 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_deallocate_matches_allocate.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_deallocate_matches_allocate.pass.cpp
@@ -22,9 +22,9 @@
 #include <vector>
 
 struct allocation_record {
-  size_t bytes;
-  size_t align;
-  explicit allocation_record(size_t b, size_t a) : bytes(b), align(a) {}
+  std::size_t bytes;
+  std::size_t align;
+  explicit allocation_record(std::size_t b, size_t a) : bytes(b), align(a) {}
   bool operator==(const allocation_record& rhs) const { return (bytes == rhs.bytes) && (align == rhs.align); }
   bool operator<(const allocation_record& rhs) const {
     if (bytes != rhs.bytes)
@@ -34,12 +34,12 @@ struct allocation_record {
 };
 
 class test_resource : public std::pmr::memory_resource {
-  void* do_allocate(size_t bytes, size_t align) override {
+  void* do_allocate(std::size_t bytes, size_t align) override {
     void* result = std::pmr::new_delete_resource()->allocate(bytes, align);
     successful_allocations.emplace_back(bytes, align);
     return result;
   }
-  void do_deallocate(void* p, size_t bytes, size_t align) override {
+  void do_deallocate(void* p, std::size_t bytes, size_t align) override {
     deallocations.emplace_back(bytes, align);
     return std::pmr::new_delete_resource()->deallocate(p, bytes, align);
   }
@@ -70,7 +70,7 @@ void test_allocation_pattern(F do_pattern) {
       tr.deallocations.end()));
 }
 
-template <size_t Bytes, size_t Align>
+template <std::size_t Bytes, size_t Align>
 auto foo() {
   return [=](auto& mr) {
     void* p = mr.allocate(Bytes, Align);

diff  --git a/libcxx/test/std/utilities/utility/utility.inplace/inplace.pass.cpp b/libcxx/test/std/utilities/utility/utility.inplace/inplace.pass.cpp
index 8a1afe2b41fa5..79a9f5ffb98d3 100644
--- a/libcxx/test/std/utilities/utility/utility.inplace/inplace.pass.cpp
+++ b/libcxx/test/std/utilities/utility/utility.inplace/inplace.pass.cpp
@@ -61,12 +61,12 @@ int main(int, char**) {
     {
         using T1 = std::in_place_index_t<0>;
         using T2 = std::in_place_index_t<1>;
-        using T3 = std::in_place_index_t<static_cast<size_t>(-1)>;
+        using T3 = std::in_place_index_t<static_cast<std::size_t>(-1)>;
         static_assert(!std::is_same<T1, T2>::value && !std::is_same<T1, T3>::value);
         static_assert(!std::is_same<T2, T3>::value);
         static_assert(check_tag<T1>(std::in_place_index<0>));
         static_assert(check_tag<T2>(std::in_place_index<1>));
-        static_assert(check_tag<T3>(std::in_place_index<static_cast<size_t>(-1)>));
+        static_assert(check_tag<T3>(std::in_place_index<static_cast<std::size_t>(-1)>));
     }
 
   return 0;

diff  --git a/libcxx/test/std/utilities/variant/variant.get/get_index.pass.cpp b/libcxx/test/std/utilities/variant/variant.get/get_index.pass.cpp
index b18d94fb0c0f3..4e6cc65a9adc9 100644
--- a/libcxx/test/std/utilities/variant/variant.get/get_index.pass.cpp
+++ b/libcxx/test/std/utilities/variant/variant.get/get_index.pass.cpp
@@ -234,7 +234,7 @@ void test_const_rvalue_get() {
 #endif
 }
 
-template <std::size_t I> using Idx = std::integral_constant<size_t, I>;
+template <std::size_t I> using Idx = std::integral_constant<std::size_t, I>;
 
 void test_throws_for_all_value_categories() {
 #ifndef TEST_HAS_NO_EXCEPTIONS
@@ -245,8 +245,8 @@ void test_throws_for_all_value_categories() {
   V v1(42l);
   const V &cv1 = v1;
   assert(v1.index() == 1);
-  std::integral_constant<size_t, 0> zero;
-  std::integral_constant<size_t, 1> one;
+  std::integral_constant<std::size_t, 0> zero;
+  std::integral_constant<std::size_t, 1> one;
   auto test = [](auto idx, auto &&v) {
     using Idx = decltype(idx);
     try {

diff  --git a/libcxx/test/std/utilities/variant/variant.hash/hash.pass.cpp b/libcxx/test/std/utilities/variant/variant.hash/hash.pass.cpp
index 770bbecd73cba..f472144403d55 100644
--- a/libcxx/test/std/utilities/variant/variant.hash/hash.pass.cpp
+++ b/libcxx/test/std/utilities/variant/variant.hash/hash.pass.cpp
@@ -24,7 +24,7 @@
 #ifndef TEST_HAS_NO_EXCEPTIONS
 namespace std {
 template <> struct hash<::MakeEmptyT> {
-  size_t operator()(const ::MakeEmptyT &) const {
+  std::size_t operator()(const ::MakeEmptyT &) const {
     assert(false);
     return 0;
   }
@@ -127,7 +127,7 @@ namespace std {
 
 template <>
 struct hash<B> {
-  size_t operator()(B const&) const {
+  std::size_t operator()(B const&) const {
     return 0;
   }
 };

diff  --git a/libcxx/test/std/utilities/variant/variant.helpers/variant_alternative.pass.cpp b/libcxx/test/std/utilities/variant/variant.helpers/variant_alternative.pass.cpp
index f5e1e3d2c9ef5..be1a0c960d1ce 100644
--- a/libcxx/test/std/utilities/variant/variant.helpers/variant_alternative.pass.cpp
+++ b/libcxx/test/std/utilities/variant/variant.helpers/variant_alternative.pass.cpp
@@ -27,7 +27,7 @@
 #include "test_macros.h"
 #include "variant_test_helpers.h"
 
-template <class V, size_t I, class E> void test() {
+template <class V, std::size_t I, class E> void test() {
   static_assert(
       std::is_same_v<typename std::variant_alternative<I, V>::type, E>, "");
   static_assert(

diff  --git a/libcxx/test/std/utilities/variant/variant.helpers/variant_size.pass.cpp b/libcxx/test/std/utilities/variant/variant.helpers/variant_size.pass.cpp
index 8c5b70d6f88dc..1ee0c324d7b87 100644
--- a/libcxx/test/std/utilities/variant/variant.helpers/variant_size.pass.cpp
+++ b/libcxx/test/std/utilities/variant/variant.helpers/variant_size.pass.cpp
@@ -23,7 +23,7 @@
 
 #include "test_macros.h"
 
-template <class V, size_t E> void test() {
+template <class V, std::size_t E> void test() {
   static_assert(std::variant_size<V>::value == E, "");
   static_assert(std::variant_size<const V>::value == E, "");
   static_assert(std::variant_size<volatile V>::value == E, "");

diff  --git a/libcxx/test/std/utilities/variant/variant.variant/variant.assign/copy.pass.cpp b/libcxx/test/std/utilities/variant/variant.variant/variant.assign/copy.pass.cpp
index 46ccd44096653..f92b2753c4c7d 100644
--- a/libcxx/test/std/utilities/variant/variant.variant/variant.assign/copy.pass.cpp
+++ b/libcxx/test/std/utilities/variant/variant.variant/variant.assign/copy.pass.cpp
@@ -322,7 +322,7 @@ void test_copy_assignment_empty_non_empty() {
 #endif // TEST_HAS_NO_EXCEPTIONS
 }
 
-template <typename T> struct Result { size_t index; T value; };
+template <typename T> struct Result { std::size_t index; T value; };
 
 void test_copy_assignment_same_index() {
   {
@@ -550,7 +550,7 @@ void test_copy_assignment_
diff erent_index() {
   }
 }
 
-template <size_t NewIdx, class ValueType>
+template <std::size_t NewIdx, class ValueType>
 constexpr bool test_constexpr_assign_imp(
     std::variant<long, void*, int>&& v, ValueType&& new_value)
 {

diff  --git a/libcxx/test/std/utilities/variant/variant.variant/variant.assign/move.pass.cpp b/libcxx/test/std/utilities/variant/variant.variant/variant.assign/move.pass.cpp
index 775330f8bf71a..700554454c190 100644
--- a/libcxx/test/std/utilities/variant/variant.variant/variant.assign/move.pass.cpp
+++ b/libcxx/test/std/utilities/variant/variant.variant/variant.assign/move.pass.cpp
@@ -291,7 +291,7 @@ void test_move_assignment_empty_non_empty() {
 #endif // TEST_HAS_NO_EXCEPTIONS
 }
 
-template <typename T> struct Result { size_t index; T value; };
+template <typename T> struct Result { std::size_t index; T value; };
 
 void test_move_assignment_same_index() {
   {
@@ -464,7 +464,7 @@ void test_move_assignment_
diff erent_index() {
   }
 }
 
-template <size_t NewIdx, class ValueType>
+template <std::size_t NewIdx, class ValueType>
 constexpr bool test_constexpr_assign_imp(
     std::variant<long, void*, int>&& v, ValueType&& new_value)
 {

diff  --git a/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp b/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp
index b328ba4cbe8ad..52b0d88eb7389 100644
--- a/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp
+++ b/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp
@@ -223,7 +223,7 @@ void test_copy_ctor_valueless_by_exception() {
 #endif // TEST_HAS_NO_EXCEPTIONS
 }
 
-template <size_t Idx>
+template <std::size_t Idx>
 constexpr bool test_constexpr_copy_ctor_imp(std::variant<long, void*, const int> const& v) {
   auto v2 = v;
   return v2.index() == v.index() &&

diff  --git a/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp b/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp
index 1c67f020d1107..7d813a09b18d6 100644
--- a/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp
+++ b/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp
@@ -161,7 +161,7 @@ void test_move_ctor_sfinae() {
 }
 
 template <typename T>
-struct Result { size_t index; T value; };
+struct Result { std::size_t index; T value; };
 
 void test_move_ctor_basic() {
   {
@@ -292,7 +292,7 @@ void test_move_ctor_valueless_by_exception() {
 #endif // TEST_HAS_NO_EXCEPTIONS
 }
 
-template <size_t Idx>
+template <std::size_t Idx>
 constexpr bool test_constexpr_ctor_imp(std::variant<long, void*, const int> const& v) {
   auto copy = v;
   auto v2 = std::move(copy);

diff  --git a/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_args.pass.cpp b/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_args.pass.cpp
index 37a18496be983..4dbe7a8ba43ea 100644
--- a/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_args.pass.cpp
+++ b/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_args.pass.cpp
@@ -28,18 +28,18 @@
 #include "test_macros.h"
 #include "variant_test_helpers.h"
 
-template <class Var, size_t I, class... Args>
+template <class Var, std::size_t I, class... Args>
 constexpr auto test_emplace_exists_imp(int) -> decltype(
     std::declval<Var>().template emplace<I>(std::declval<Args>()...), true) {
   return true;
 }
 
-template <class, size_t, class...>
+template <class, std::size_t, class...>
 constexpr auto test_emplace_exists_imp(long) -> bool {
   return false;
 }
 
-template <class Var, size_t I, class... Args> constexpr bool emplace_exists() {
+template <class Var, std::size_t I, class... Args> constexpr bool emplace_exists() {
   return test_emplace_exists_imp<Var, I, Args...>(0);
 }
 

diff  --git a/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_init_list_args.pass.cpp b/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_init_list_args.pass.cpp
index 308067897f52f..b598df0de9c7e 100644
--- a/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_init_list_args.pass.cpp
+++ b/libcxx/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_init_list_args.pass.cpp
@@ -39,18 +39,18 @@ struct InitListArg {
       : size(il.size()), value(v) {}
 };
 
-template <class Var, size_t I, class... Args>
+template <class Var, std::size_t I, class... Args>
 constexpr auto test_emplace_exists_imp(int) -> decltype(
     std::declval<Var>().template emplace<I>(std::declval<Args>()...), true) {
   return true;
 }
 
-template <class, size_t, class...>
+template <class, std::size_t, class...>
 constexpr auto test_emplace_exists_imp(long) -> bool {
   return false;
 }
 
-template <class Var, size_t I, class... Args> constexpr bool emplace_exists() {
+template <class Var, std::size_t I, class... Args> constexpr bool emplace_exists() {
   return test_emplace_exists_imp<Var, I, Args...>(0);
 }
 

diff  --git a/libcxx/test/std/utilities/variant/variant.visit/visit.pass.cpp b/libcxx/test/std/utilities/variant/variant.visit/visit.pass.cpp
index 1e29073bba2d9..cfd1290d154e9 100644
--- a/libcxx/test/std/utilities/variant/variant.visit/visit.pass.cpp
+++ b/libcxx/test/std/utilities/variant/variant.visit/visit.pass.cpp
@@ -347,7 +347,7 @@ void test_caller_accepts_nonconst() {
 struct MyVariant : std::variant<short, long, float> {};
 
 namespace std {
-template <size_t Index>
+template <std::size_t Index>
 void get(const MyVariant&) {
   assert(false);
 }

diff  --git a/libcxx/test/support/MoveOnly.h b/libcxx/test/support/MoveOnly.h
index 0795cac4ef5df..4a1c1fc09cd48 100644
--- a/libcxx/test/support/MoveOnly.h
+++ b/libcxx/test/support/MoveOnly.h
@@ -61,8 +61,8 @@ template <>
 struct std::hash<MoveOnly>
 {
     typedef MoveOnly argument_type;
-    typedef size_t result_type;
-    TEST_CONSTEXPR size_t operator()(const MoveOnly& x) const {return static_cast<size_t>(x.get());}
+    typedef std::size_t result_type;
+    TEST_CONSTEXPR std::size_t operator()(const MoveOnly& x) const {return static_cast<size_t>(x.get());}
 };
 
 #endif // MOVEONLY_H

diff  --git a/libcxx/test/support/allocators.h b/libcxx/test/support/allocators.h
index 0cdaacb7555c4..2b987ad872783 100644
--- a/libcxx/test/support/allocators.h
+++ b/libcxx/test/support/allocators.h
@@ -9,6 +9,7 @@
 #ifndef ALLOCATORS_H
 #define ALLOCATORS_H
 
+#include <cstddef>
 #include <memory>
 #include <new>
 #include <type_traits>

diff  --git a/libcxx/test/support/charconv_test_helpers.h b/libcxx/test/support/charconv_test_helpers.h
index 1e8010a3b97a7..455546a394db5 100644
--- a/libcxx/test/support/charconv_test_helpers.h
+++ b/libcxx/test/support/charconv_test_helpers.h
@@ -12,6 +12,7 @@
 #include <algorithm>
 #include <charconv>
 #include <cassert>
+#include <cstddef>
 #include <limits>
 #include <numeric>
 #include <string.h>
@@ -79,12 +80,12 @@ fits_in(T v)
 template <typename X>
 struct to_chars_test_base
 {
-    template <typename T, size_t N, typename... Ts>
+    template <typename T, std::size_t N, typename... Ts>
     TEST_CONSTEXPR_CXX23 void test(T v, char const (&expect)[N], Ts... args)
     {
         std::to_chars_result r;
 
-        constexpr size_t len = N - 1;
+        constexpr std::size_t len = N - 1;
         static_assert(len > 0, "expected output won't be empty");
 
         if (!fits_in<X>(v))
@@ -111,7 +112,7 @@ struct to_chars_test_base
         std::iota(buf, buf + sizeof(buf), static_cast<unsigned char>(1));
         r = std::to_chars(buf, buf + sizeof(buf), v, args...);
         assert(r.ec == std::errc{});
-        for (size_t i = r.ptr - buf; i < sizeof(buf); ++i)
+        for (std::size_t i = r.ptr - buf; i < sizeof(buf); ++i)
             assert(static_cast<unsigned char>(buf[i]) == i + 1);
         *r.ptr = '\0';
 

diff  --git a/libcxx/test/support/constexpr_char_traits.h b/libcxx/test/support/constexpr_char_traits.h
index 56c22fe72581f..75380d5a7ffbb 100644
--- a/libcxx/test/support/constexpr_char_traits.h
+++ b/libcxx/test/support/constexpr_char_traits.h
@@ -12,6 +12,7 @@
 
 #include <string>
 #include <cassert>
+#include <cstddef>
 
 #include "test_macros.h"
 
@@ -35,12 +36,12 @@ struct constexpr_char_traits
     static TEST_CONSTEXPR  bool lt(char_type c1, char_type c2) TEST_NOEXCEPT
         {return c1 < c2;}
 
-    static TEST_CONSTEXPR_CXX14 int              compare(const char_type* s1, const char_type* s2, size_t n);
-    static TEST_CONSTEXPR_CXX14 size_t           length(const char_type* s);
-    static TEST_CONSTEXPR_CXX14 const char_type* find(const char_type* s, size_t n, const char_type& a);
-    static TEST_CONSTEXPR_CXX14 char_type*       move(char_type* s1, const char_type* s2, size_t n);
-    static TEST_CONSTEXPR_CXX14 char_type*       copy(char_type* s1, const char_type* s2, size_t n);
-    static TEST_CONSTEXPR_CXX14 char_type*       assign(char_type* s, size_t n, char_type a);
+    static TEST_CONSTEXPR_CXX14 int              compare(const char_type* s1, const char_type* s2, std::size_t n);
+    static TEST_CONSTEXPR_CXX14 std::size_t           length(const char_type* s);
+    static TEST_CONSTEXPR_CXX14 const char_type* find(const char_type* s, std::size_t n, const char_type& a);
+    static TEST_CONSTEXPR_CXX14 char_type*       move(char_type* s1, const char_type* s2, std::size_t n);
+    static TEST_CONSTEXPR_CXX14 char_type*       copy(char_type* s1, const char_type* s2, std::size_t n);
+    static TEST_CONSTEXPR_CXX14 char_type*       assign(char_type* s, std::size_t n, char_type a);
 
     static TEST_CONSTEXPR int_type  not_eof(int_type c) TEST_NOEXCEPT
         {return eq_int_type(c, eof()) ? ~eof() : c;}
@@ -61,7 +62,7 @@ struct constexpr_char_traits
 
 template <class CharT>
 TEST_CONSTEXPR_CXX14 int
-constexpr_char_traits<CharT>::compare(const char_type* s1, const char_type* s2, size_t n)
+constexpr_char_traits<CharT>::compare(const char_type* s1, const char_type* s2, std::size_t n)
 {
     for (; n; --n, ++s1, ++s2)
     {
@@ -74,10 +75,10 @@ constexpr_char_traits<CharT>::compare(const char_type* s1, const char_type* s2,
 }
 
 template <class CharT>
-TEST_CONSTEXPR_CXX14 size_t
+TEST_CONSTEXPR_CXX14 std::size_t
 constexpr_char_traits<CharT>::length(const char_type* s)
 {
-    size_t len = 0;
+    std::size_t len = 0;
     for (; !eq(*s, char_type(0)); ++s)
         ++len;
     return len;
@@ -85,7 +86,7 @@ constexpr_char_traits<CharT>::length(const char_type* s)
 
 template <class CharT>
 TEST_CONSTEXPR_CXX14 const CharT*
-constexpr_char_traits<CharT>::find(const char_type* s, size_t n, const char_type& a)
+constexpr_char_traits<CharT>::find(const char_type* s, std::size_t n, const char_type& a)
 {
     for (; n; --n)
     {
@@ -98,7 +99,7 @@ constexpr_char_traits<CharT>::find(const char_type* s, size_t n, const char_type
 
 template <class CharT>
 TEST_CONSTEXPR_CXX14 CharT*
-constexpr_char_traits<CharT>::move(char_type* s1, const char_type* s2, size_t n)
+constexpr_char_traits<CharT>::move(char_type* s1, const char_type* s2, std::size_t n)
 {
     char_type* r = s1;
     if (s1 < s2)
@@ -118,7 +119,7 @@ constexpr_char_traits<CharT>::move(char_type* s1, const char_type* s2, size_t n)
 
 template <class CharT>
 TEST_CONSTEXPR_CXX14 CharT*
-constexpr_char_traits<CharT>::copy(char_type* s1, const char_type* s2, size_t n)
+constexpr_char_traits<CharT>::copy(char_type* s1, const char_type* s2, std::size_t n)
 {
     if (!TEST_IS_CONSTANT_EVALUATED) // fails in constexpr because we might be comparing unrelated pointers
         assert(s2 < s1 || s2 >= s1+n);
@@ -130,7 +131,7 @@ constexpr_char_traits<CharT>::copy(char_type* s1, const char_type* s2, size_t n)
 
 template <class CharT>
 TEST_CONSTEXPR_CXX14 CharT*
-constexpr_char_traits<CharT>::assign(char_type* s, size_t n, char_type a)
+constexpr_char_traits<CharT>::assign(char_type* s, std::size_t n, char_type a)
 {
     char_type* r = s;
     for (; n; --n, ++s)

diff  --git a/libcxx/test/support/container_test_types.h b/libcxx/test/support/container_test_types.h
index 96e2e2d2ea8c8..ed26ba5d40af5 100644
--- a/libcxx/test/support/container_test_types.h
+++ b/libcxx/test/support/container_test_types.h
@@ -86,6 +86,7 @@
  */
 
 #include <cassert>
+#include <cstddef>
 #include <functional>
 #include <new>
 #include <utility>
@@ -428,9 +429,9 @@ namespace std {
   template <int ID>
   struct hash< ::CopyInsertable<ID> > {
     typedef ::CopyInsertable<ID> argument_type;
-    typedef size_t result_type;
+    typedef std::size_t result_type;
 
-    size_t operator()(argument_type const& arg) const {
+    std::size_t operator()(argument_type const& arg) const {
       return arg.data;
     }
   };

diff  --git a/libcxx/test/support/controlled_allocators.h b/libcxx/test/support/controlled_allocators.h
index 1144ae4c6ecd5..be517d6075b76 100644
--- a/libcxx/test/support/controlled_allocators.h
+++ b/libcxx/test/support/controlled_allocators.h
@@ -29,7 +29,7 @@ struct AllocController;
     // 'AllocController' is a concrete type that instruments and controls the
     // behavior of test allocators.
 
-template <class T, size_t ID = 0>
+template <class T, std::size_t ID = 0>
 class CountingAllocator;
     // 'CountingAllocator' is an basic implementation of the 'Allocator'
     // requirements that use the 'AllocController' interface.
@@ -97,7 +97,7 @@ struct AllocController {
 
     AllocController() = default;
 
-    void countAlloc(void* p, size_t s, size_t a) {
+    void countAlloc(void* p, std::size_t s, size_t a) {
         ++alive;
         ++alloc_count;
         alive_size += s;
@@ -107,7 +107,7 @@ struct AllocController {
         last_align = last_alloc_align = a;
     }
 
-    void countDealloc(void* p, size_t s, size_t a) {
+    void countDealloc(void* p, std::size_t s, size_t a) {
         --alive;
         ++dealloc_count;
         alive_size -= s;
@@ -144,35 +144,35 @@ struct AllocController {
       last_destroy_pointer = nullptr;
     }
 public:
-    bool checkAlloc(void* p, size_t s, size_t a) const {
+    bool checkAlloc(void* p, std::size_t s, size_t a) const {
         return p == last_alloc_pointer &&
                s == last_alloc_size &&
                a == last_alloc_align;
     }
 
-    bool checkAlloc(void* p, size_t s) const {
+    bool checkAlloc(void* p, std::size_t s) const {
         return p == last_alloc_pointer &&
                s == last_alloc_size;
     }
 
-    bool checkAllocAtLeast(void* p, size_t s, size_t a) const {
+    bool checkAllocAtLeast(void* p, std::size_t s, size_t a) const {
         return p == last_alloc_pointer &&
                s <= last_alloc_size &&
                a <= last_alloc_align;
     }
 
-    bool checkAllocAtLeast(void* p, size_t s) const {
+    bool checkAllocAtLeast(void* p, std::size_t s) const {
         return p == last_alloc_pointer &&
                s <= last_alloc_size;
     }
 
-    bool checkDealloc(void* p, size_t s, size_t a) const {
+    bool checkDealloc(void* p, std::size_t s, size_t a) const {
         return p == last_dealloc_pointer &&
                s == last_dealloc_size &&
                a == last_dealloc_align;
     }
 
-    bool checkDealloc(void* p, size_t s) const {
+    bool checkDealloc(void* p, std::size_t s) const {
         return p == last_dealloc_pointer &&
                s == last_dealloc_size;
     }
@@ -222,7 +222,7 @@ struct AllocController {
   DISALLOW_COPY(AllocController);
 };
 
-template <class T, size_t ID>
+template <class T, std::size_t ID>
 class CountingAllocator
 {
 public:
@@ -282,12 +282,12 @@ class CountingAllocator
     AllocController& getController() const { return *P; }
 
 private:
-    template <class Tp, size_t XID> friend class CountingAllocator;
+    template <class Tp, std::size_t XID> friend class CountingAllocator;
     AllocController *P;
 };
 
 
-template <size_t ID>
+template <std::size_t ID>
 class CountingAllocator<void, ID>
 {
 public:
@@ -325,17 +325,17 @@ class CountingAllocator<void, ID>
     AllocController& getController() const { return *P; }
 
 private:
-    template <class Tp, size_t> friend class CountingAllocator;
+    template <class Tp, std::size_t> friend class CountingAllocator;
     AllocController *P;
 };
 
-template <class T, class U, size_t ID>
+template <class T, class U, std::size_t ID>
 inline bool operator==(CountingAllocator<T, ID> const& x,
                        CountingAllocator<U, ID> const& y) {
     return &x.getController() == &y.getController();
 }
 
-template <class T, class U, size_t ID>
+template <class T, class U, std::size_t ID>
 inline bool operator!=(CountingAllocator<T, ID> const& x,
                        CountingAllocator<U, ID> const& y) {
     return !(x == y);

diff  --git a/libcxx/test/support/counting_predicates.h b/libcxx/test/support/counting_predicates.h
index ef3c293109a9d..7bf58b251b1f7 100644
--- a/libcxx/test/support/counting_predicates.h
+++ b/libcxx/test/support/counting_predicates.h
@@ -23,12 +23,12 @@ struct unary_counting_predicate {
     ~unary_counting_predicate() {}
 
     bool operator () (const Arg &a) const { ++count_; return p_(a); }
-    size_t count() const { return count_; }
+    std::size_t count() const { return count_; }
     void reset() { count_ = 0; }
 
 private:
     Predicate p_;
-    mutable size_t count_;
+    mutable std::size_t count_;
 };
 
 
@@ -43,12 +43,12 @@ struct binary_counting_predicate {
     ~binary_counting_predicate() {}
 
     bool operator () (const Arg1 &a1, const Arg2 &a2) const { ++count_; return p_(a1, a2); }
-    size_t count() const { return count_; }
+    std::size_t count() const { return count_; }
     void reset() { count_ = 0; }
 
 private:
     Predicate p_;
-    mutable size_t count_;
+    mutable std::size_t count_;
 };
 
 #if TEST_STD_VER > 14

diff  --git a/libcxx/test/support/deduction_guides_sfinae_checks.h b/libcxx/test/support/deduction_guides_sfinae_checks.h
index 767ff0242e1fe..5ada5ac28e8c8 100644
--- a/libcxx/test/support/deduction_guides_sfinae_checks.h
+++ b/libcxx/test/support/deduction_guides_sfinae_checks.h
@@ -9,6 +9,7 @@
 #ifndef TEST_SUPPORT_DEDUCTION_GUIDES_SFINAE_CHECKS_H
 #define TEST_SUPPORT_DEDUCTION_GUIDES_SFINAE_CHECKS_H
 
+#include <cstddef>
 #include <functional>
 #include <initializer_list>
 #include <iterator>
@@ -178,30 +179,30 @@ constexpr void UnorderedContainerDeductionGuidesSfinaeAway() {
   // (iter, iter, buckets)
   //
   // Cannot deduce from (BAD_iter, BAD_iter, buckets)
-  static_assert(SFINAEs_away<Container, BadIter, BadIter, size_t>);
-  LIBCPP_STATIC_ASSERT(SFINAEs_away<Container, OutputIter, OutputIter, size_t>);
+  static_assert(SFINAEs_away<Container, BadIter, BadIter, std::size_t>);
+  LIBCPP_STATIC_ASSERT(SFINAEs_away<Container, OutputIter, OutputIter, std::size_t>);
 
   // (iter, iter, buckets, hash)
   //
   // Cannot deduce from (BAD_iter, BAD_iter, buckets, hash)
-  static_assert(SFINAEs_away<Container, BadIter, BadIter, size_t, Hash>);
+  static_assert(SFINAEs_away<Container, BadIter, BadIter, std::size_t, Hash>);
   LIBCPP_STATIC_ASSERT(
-      SFINAEs_away<Container, OutputIter, OutputIter, size_t, Hash>);
+      SFINAEs_away<Container, OutputIter, OutputIter, std::size_t, Hash>);
   // Cannot deduce from (iter, iter, buckets, BAD_hash)
-  static_assert(SFINAEs_away<Container, Iter, Iter, size_t, BadHash>);
+  static_assert(SFINAEs_away<Container, Iter, Iter, std::size_t, BadHash>);
   // Note: (iter, iter, buckets, ALLOC_as_hash) is allowed -- it just calls
   // (iter, iter, buckets, alloc)
 
   // (iter, iter, buckets, hash, pred)
   //
   // Cannot deduce from (BAD_iter, BAD_iter, buckets, hash, pred)
-  static_assert(SFINAEs_away<Container, BadIter, BadIter, size_t, Hash, Pred>);
+  static_assert(SFINAEs_away<Container, BadIter, BadIter, std::size_t, Hash, Pred>);
   LIBCPP_STATIC_ASSERT(
-      SFINAEs_away<Container, OutputIter, OutputIter, size_t, Hash, Pred>);
+      SFINAEs_away<Container, OutputIter, OutputIter, std::size_t, Hash, Pred>);
   // Cannot deduce from (iter, iter, buckets, BAD_hash, pred)
-  static_assert(SFINAEs_away<Container, Iter, Iter, size_t, BadHash, Pred>);
+  static_assert(SFINAEs_away<Container, Iter, Iter, std::size_t, BadHash, Pred>);
   // Cannot deduce from (iter, iter, buckets, ALLOC_as_hash, pred)
-  static_assert(SFINAEs_away<Container, Iter, Iter, size_t, AllocAsHash, Pred>);
+  static_assert(SFINAEs_away<Container, Iter, Iter, std::size_t, AllocAsHash, Pred>);
   // Note: (iter, iter, buckets, hash, ALLOC_as_pred) is allowed -- it just
   // calls (iter, iter, buckets, hash, alloc)
 
@@ -209,28 +210,28 @@ constexpr void UnorderedContainerDeductionGuidesSfinaeAway() {
   //
   // Cannot deduce from (BAD_iter, BAD_iter, buckets, hash, pred, alloc)
   static_assert(
-      SFINAEs_away<Container, BadIter, BadIter, size_t, Hash, Pred, Alloc>);
+      SFINAEs_away<Container, BadIter, BadIter, std::size_t, Hash, Pred, Alloc>);
   LIBCPP_STATIC_ASSERT(SFINAEs_away<Container, OutputIter, OutputIter,
-      size_t, Hash, Pred, Alloc>);
+      std::size_t, Hash, Pred, Alloc>);
   // Cannot deduce from (iter, iter, buckets, BAD_hash, pred, alloc)
   static_assert(
-      SFINAEs_away<Container, Iter, Iter, size_t, BadHash, Pred, Alloc>);
+      SFINAEs_away<Container, Iter, Iter, std::size_t, BadHash, Pred, Alloc>);
   // Cannot deduce from (iter, iter, buckets, ALLOC_as_hash, pred, alloc)
   static_assert(
-      SFINAEs_away<Container, Iter, Iter, size_t, AllocAsHash, Pred, Alloc>);
+      SFINAEs_away<Container, Iter, Iter, std::size_t, AllocAsHash, Pred, Alloc>);
   // Cannot deduce from (iter, iter, buckets, hash, ALLOC_as_pred, alloc)
   static_assert(
-      SFINAEs_away<Container, Iter, Iter, size_t, Hash, AllocAsPred, Alloc>);
+      SFINAEs_away<Container, Iter, Iter, std::size_t, Hash, AllocAsPred, Alloc>);
   // Cannot deduce from (iter, iter, buckets, hash, pred, BAD_alloc)
   static_assert(
-      SFINAEs_away<Container, Iter, Iter, size_t, Hash, Pred, BadAlloc>);
+      SFINAEs_away<Container, Iter, Iter, std::size_t, Hash, Pred, BadAlloc>);
 
   // (iter, iter, buckets, alloc)
   //
   // Cannot deduce from (BAD_iter, BAD_iter, buckets, alloc)
-  static_assert(SFINAEs_away<Container, BadIter, BadIter, size_t, Alloc>);
+  static_assert(SFINAEs_away<Container, BadIter, BadIter, std::size_t, Alloc>);
   LIBCPP_STATIC_ASSERT(
-      SFINAEs_away<Container, OutputIter, OutputIter, size_t, Alloc>);
+      SFINAEs_away<Container, OutputIter, OutputIter, std::size_t, Alloc>);
   // Note: (iter, iter, buckets, BAD_alloc) is interpreted as (iter, iter,
   // buckets, hash), which is valid because the only requirement for the hash
   // parameter is that it's not integral.
@@ -246,14 +247,14 @@ constexpr void UnorderedContainerDeductionGuidesSfinaeAway() {
   // (iter, iter, buckets, hash, alloc)
   //
   // Cannot deduce from (BAD_iter, BAD_iter, buckets, hash, alloc)
-  static_assert(SFINAEs_away<Container, BadIter, BadIter, size_t, Hash, Alloc>);
+  static_assert(SFINAEs_away<Container, BadIter, BadIter, std::size_t, Hash, Alloc>);
   LIBCPP_STATIC_ASSERT(
-      SFINAEs_away<Container, OutputIter, OutputIter, size_t, Hash, Alloc>);
+      SFINAEs_away<Container, OutputIter, OutputIter, std::size_t, Hash, Alloc>);
   // Cannot deduce from (iter, iter, buckets, BAD_hash, alloc)
-  static_assert(SFINAEs_away<Container, Iter, Iter, size_t, BadHash, Alloc>);
+  static_assert(SFINAEs_away<Container, Iter, Iter, std::size_t, BadHash, Alloc>);
   // Cannot deduce from (iter, iter, buckets, ALLOC_as_hash, alloc)
   static_assert(
-      SFINAEs_away<Container, Iter, Iter, size_t, AllocAsHash, Alloc>);
+      SFINAEs_away<Container, Iter, Iter, std::size_t, AllocAsHash, Alloc>);
   // Note: (iter, iter, buckets, hash, BAD_alloc) is interpreted as (iter, iter,
   // buckets, hash, pred), which is valid because there are no requirements for
   // the predicate.
@@ -261,16 +262,16 @@ constexpr void UnorderedContainerDeductionGuidesSfinaeAway() {
   // (init_list, buckets, hash)
   //
   // Cannot deduce from (init_list, buckets, BAD_hash)
-  static_assert(SFINAEs_away<Container, InitList, size_t, BadHash>);
+  static_assert(SFINAEs_away<Container, InitList, std::size_t, BadHash>);
   // Note: (init_list, buckets, ALLOC_as_hash) is interpreted as (init_list,
   // buckets, alloc), which is valid.
 
   // (init_list, buckets, hash, pred)
   //
   // Cannot deduce from (init_list, buckets, BAD_hash, pred)
-  static_assert(SFINAEs_away<Container, InitList, size_t, BadHash, Pred>);
+  static_assert(SFINAEs_away<Container, InitList, std::size_t, BadHash, Pred>);
   // Cannot deduce from (init_list, buckets, ALLOC_as_hash, pred)
-  static_assert(SFINAEs_away<Container, InitList, size_t, AllocAsHash, Pred>);
+  static_assert(SFINAEs_away<Container, InitList, std::size_t, AllocAsHash, Pred>);
   // Note: (init_list, buckets, hash, ALLOC_as_pred) is interpreted as
   // (init_list, buckets, hash, alloc), which is valid.
 
@@ -278,16 +279,16 @@ constexpr void UnorderedContainerDeductionGuidesSfinaeAway() {
   //
   // Cannot deduce from (init_list, buckets, BAD_hash, pred, alloc)
   static_assert(
-      SFINAEs_away<Container, InitList, size_t, BadHash, Pred, Alloc>);
+      SFINAEs_away<Container, InitList, std::size_t, BadHash, Pred, Alloc>);
   // Cannot deduce from (init_list, buckets, ALLOC_as_hash, pred, alloc)
   static_assert(
-      SFINAEs_away<Container, InitList, size_t, AllocAsHash, Pred, Alloc>);
+      SFINAEs_away<Container, InitList, std::size_t, AllocAsHash, Pred, Alloc>);
   // Cannot deduce from (init_list, buckets, hash, ALLOC_as_pred, alloc)
   static_assert(
-      SFINAEs_away<Container, InitList, size_t, Hash, AllocAsPred, Alloc>);
+      SFINAEs_away<Container, InitList, std::size_t, Hash, AllocAsPred, Alloc>);
   // Cannot deduce from (init_list, buckets, hash, pred, BAD_alloc)
   static_assert(
-      SFINAEs_away<Container, InitList, size_t, Hash, Pred, BadAlloc>);
+      SFINAEs_away<Container, InitList, std::size_t, Hash, Pred, BadAlloc>);
 
   // (init_list, buckets, alloc)
   //
@@ -298,9 +299,9 @@ constexpr void UnorderedContainerDeductionGuidesSfinaeAway() {
   // (init_list, buckets, hash, alloc)
   //
   // Cannot deduce from (init_list, buckets, BAD_hash, alloc)
-  static_assert(SFINAEs_away<Container, InitList, size_t, BadHash, Alloc>);
+  static_assert(SFINAEs_away<Container, InitList, std::size_t, BadHash, Alloc>);
   // Cannot deduce from (init_list, buckets, ALLOC_as_hash, alloc)
-  static_assert(SFINAEs_away<Container, InitList, size_t, AllocAsHash, Alloc>);
+  static_assert(SFINAEs_away<Container, InitList, std::size_t, AllocAsHash, Alloc>);
 
   // (init_list, alloc)
   //

diff  --git a/libcxx/test/support/deleter_types.h b/libcxx/test/support/deleter_types.h
index c5680020b0646..2afb9b3e6860b 100644
--- a/libcxx/test/support/deleter_types.h
+++ b/libcxx/test/support/deleter_types.h
@@ -15,6 +15,7 @@
 #ifndef SUPPORT_DELETER_TYPES_H
 #define SUPPORT_DELETER_TYPES_H
 
+#include <cstddef>
 #include <type_traits>
 #include <utility>
 #include <cassert>
@@ -385,13 +386,13 @@ void swap(test_deleter<T>& x, test_deleter<T>& y) {
 
 #if TEST_STD_VER >= 11
 
-template <class T, size_t ID = 0>
+template <class T, std::size_t ID = 0>
 class PointerDeleter {
   PointerDeleter(const PointerDeleter&);
   PointerDeleter& operator=(const PointerDeleter&);
 
 public:
-  typedef min_pointer<T, std::integral_constant<size_t, ID>> pointer;
+  typedef min_pointer<T, std::integral_constant<std::size_t, ID>> pointer;
 
   TEST_CONSTEXPR_CXX23 PointerDeleter()                            = default;
   TEST_CONSTEXPR_CXX23 PointerDeleter(PointerDeleter&&)            = default;
@@ -413,13 +414,13 @@ class PointerDeleter {
   PointerDeleter(const PointerDeleter<U, ID>&, typename std::enable_if<!std::is_same<U, T>::value>::type* = 0);
 };
 
-template <class T, size_t ID>
+template <class T, std::size_t ID>
 class PointerDeleter<T[], ID> {
   PointerDeleter(const PointerDeleter&);
   PointerDeleter& operator=(const PointerDeleter&);
 
 public:
-  typedef min_pointer<T, std::integral_constant<size_t, ID> > pointer;
+  typedef min_pointer<T, std::integral_constant<std::size_t, ID> > pointer;
 
   TEST_CONSTEXPR_CXX23 PointerDeleter()                            = default;
   TEST_CONSTEXPR_CXX23 PointerDeleter(PointerDeleter&&)            = default;

diff  --git a/libcxx/test/support/filesystem_test_helper.h b/libcxx/test/support/filesystem_test_helper.h
index 766a973c23720..5d3738b91c041 100644
--- a/libcxx/test/support/filesystem_test_helper.h
+++ b/libcxx/test/support/filesystem_test_helper.h
@@ -336,7 +336,7 @@ struct scoped_test_env
         fs::path const cwd = utils::getcwd();
         fs::path const tmp = fs::temp_directory_path();
         std::string base = cwd.filename().string();
-        size_t i = std::hash<std::string>()(cwd.string());
+        std::size_t i = std::hash<std::string>()(cwd.string());
         fs::path p = tmp / (base + "-static_env." + std::to_string(i));
         while (utils::exists(p.string())) {
             p = tmp / (base + "-static_env." + std::to_string(++i));

diff  --git a/libcxx/test/support/format.functions.common.h b/libcxx/test/support/format.functions.common.h
index e70ae34200573..65da5fd252b7e 100644
--- a/libcxx/test/support/format.functions.common.h
+++ b/libcxx/test/support/format.functions.common.h
@@ -12,6 +12,7 @@
 
 #include <algorithm>
 #include <cctype>
+#include <cstddef>
 #include <charconv>
 #include <format>
 #include <ranges>
@@ -143,7 +144,7 @@ struct std::formatter<status, CharT> {
 // The return value is a collection of basic_strings, instead of
 // basic_string_views since the values are temporaries.
 namespace detail {
-template <class CharT, size_t N>
+template <class CharT, std::size_t N>
 std::basic_string<CharT> get_colons() {
   static std::basic_string<CharT> result(N, CharT(':'));
   return result;

diff  --git a/libcxx/test/support/make_string.h b/libcxx/test/support/make_string.h
index 728b6540abe07..50dd609ce3651 100644
--- a/libcxx/test/support/make_string.h
+++ b/libcxx/test/support/make_string.h
@@ -47,18 +47,18 @@
 #define MKSTR_LEN(CharT, Str) MKSTR(Str).length((const CharT*)0)
 
 struct MultiStringType {
-  MKSTR_WCHAR_ONLY(const wchar_t* w_; size_t wn_; )
-  MKSTR_CHAR8_ONLY(const char8_t* u8_; size_t u8n_; )
-  MKSTR_CXX11_ONLY(const char16_t* u16_; size_t u16n_; )
-  MKSTR_CXX11_ONLY(const char32_t* u32_; size_t u32n_; )
-  const char* s_; size_t sn_;
+  MKSTR_WCHAR_ONLY(const wchar_t* w_; std::size_t wn_; )
+  MKSTR_CHAR8_ONLY(const char8_t* u8_; std::size_t u8n_; )
+  MKSTR_CXX11_ONLY(const char16_t* u16_; std::size_t u16n_; )
+  MKSTR_CXX11_ONLY(const char32_t* u32_; std::size_t u32n_; )
+  const char* s_; std::size_t sn_;
 
   TEST_CONSTEXPR MultiStringType(
-      MKSTR_WCHAR_ONLY(const wchar_t *w, size_t wn,)
-      MKSTR_CHAR8_ONLY(const char8_t *u8, size_t u8n,)
-      MKSTR_CXX11_ONLY(const char16_t *u16, size_t u16n,)
-      MKSTR_CXX11_ONLY(const char32_t *u32, size_t u32n,)
-      const char *s, size_t sn)
+      MKSTR_WCHAR_ONLY(const wchar_t *w, std::size_t wn,)
+      MKSTR_CHAR8_ONLY(const char8_t *u8, std::size_t u8n,)
+      MKSTR_CXX11_ONLY(const char16_t *u16, std::size_t u16n,)
+      MKSTR_CXX11_ONLY(const char32_t *u32, std::size_t u32n,)
+      const char *s, std::size_t sn)
     : MKSTR_WCHAR_ONLY(w_(w), wn_(wn),)
       MKSTR_CHAR8_ONLY(u8_(u8), u8n_(u8n),)
       MKSTR_CXX11_ONLY(u16_(u16), u16n_(u16n),)
@@ -71,11 +71,11 @@ struct MultiStringType {
   MKSTR_CXX11_ONLY(constexpr const char16_t *as_ptr(const char16_t*) const { return u16_; })
   MKSTR_CXX11_ONLY(constexpr const char32_t *as_ptr(const char32_t*) const { return u32_; })
 
-  TEST_CONSTEXPR size_t length(const char*) const { return sn_; }
-  MKSTR_WCHAR_ONLY(TEST_CONSTEXPR size_t length(const wchar_t*) const { return wn_; })
-  MKSTR_CHAR8_ONLY(constexpr size_t length(const char8_t*) const { return u8n_; })
-  MKSTR_CXX11_ONLY(constexpr size_t length(const char16_t*) const { return u16n_; })
-  MKSTR_CXX11_ONLY(constexpr size_t length(const char32_t*) const { return u32n_; })
+  TEST_CONSTEXPR std::size_t length(const char*) const { return sn_; }
+  MKSTR_WCHAR_ONLY(TEST_CONSTEXPR std::size_t length(const wchar_t*) const { return wn_; })
+  MKSTR_CHAR8_ONLY(constexpr std::size_t length(const char8_t*) const { return u8n_; })
+  MKSTR_CXX11_ONLY(constexpr std::size_t length(const char16_t*) const { return u16n_; })
+  MKSTR_CXX11_ONLY(constexpr std::size_t length(const char32_t*) const { return u32n_; })
 
   // These implicit conversions are used by some tests. TODO: maybe eliminate them?
   TEST_CONSTEXPR operator const char*() const { return s_; }

diff  --git a/libcxx/test/support/min_allocator.h b/libcxx/test/support/min_allocator.h
index f9d37e72ef631..1b3727af8185c 100644
--- a/libcxx/test/support/min_allocator.h
+++ b/libcxx/test/support/min_allocator.h
@@ -85,12 +85,12 @@ class no_default_allocator
 };
 
 struct malloc_allocator_base {
-    static size_t outstanding_bytes;
-    static size_t alloc_count;
-    static size_t dealloc_count;
+    static std::size_t outstanding_bytes;
+    static std::size_t alloc_count;
+    static std::size_t dealloc_count;
     static bool disable_default_constructor;
 
-    static size_t outstanding_alloc() {
+    static std::size_t outstanding_alloc() {
       assert(alloc_count >= dealloc_count);
       return (alloc_count - dealloc_count);
     }
@@ -123,7 +123,7 @@ class malloc_allocator : public malloc_allocator_base
 
     T* allocate(std::size_t n)
     {
-        const size_t nbytes = n*sizeof(T);
+        const std::size_t nbytes = n*sizeof(T);
         ++alloc_count;
         outstanding_bytes += nbytes;
         return static_cast<T*>(std::malloc(nbytes));
@@ -131,7 +131,7 @@ class malloc_allocator : public malloc_allocator_base
 
     void deallocate(T* p, std::size_t n)
     {
-        const size_t nbytes = n*sizeof(T);
+        const std::size_t nbytes = n*sizeof(T);
         ++dealloc_count;
         outstanding_bytes -= nbytes;
         std::free(static_cast<void*>(p));
@@ -194,7 +194,7 @@ struct cpp03_overload_allocator : bare_allocator<T>
 };
 template <class T> bool cpp03_overload_allocator<T>::construct_called = false;
 
-template <class T, class = std::integral_constant<size_t, 0> > class min_pointer;
+template <class T, class = std::integral_constant<std::size_t, 0> > class min_pointer;
 template <class T, class ID> class min_pointer<const T, ID>;
 template <class ID> class min_pointer<void, ID>;
 template <class ID> class min_pointer<const void, ID>;

diff  --git a/libcxx/test/support/nasty_containers.h b/libcxx/test/support/nasty_containers.h
index 0b56a27feefa2..18a424ba1fdbf 100644
--- a/libcxx/test/support/nasty_containers.h
+++ b/libcxx/test/support/nasty_containers.h
@@ -10,6 +10,7 @@
 #define NASTY_CONTAINERS_H
 
 #include <cassert>
+#include <cstddef>
 #include <vector>
 #include <list>
 

diff  --git a/libcxx/test/support/nasty_string.h b/libcxx/test/support/nasty_string.h
index 901700abef37c..672c3cb4ed9ea 100644
--- a/libcxx/test/support/nasty_string.h
+++ b/libcxx/test/support/nasty_string.h
@@ -10,6 +10,7 @@
 #define TEST_SUPPORT_NASTY_STRING_H
 
 #include <algorithm>
+#include <cstddef>
 #include <string>
 #include <type_traits>
 
@@ -72,12 +73,12 @@ struct nasty_char_traits {
 
   static constexpr bool lt(char_type c1, char_type c2) noexcept { return c1.c < c2.c; }
 
-  static constexpr int compare(const char_type* s1, const char_type* s2, size_t n);
-  static constexpr size_t length(const char_type* s);
-  static constexpr const char_type* find(const char_type* s, size_t n, const char_type& a);
-  static constexpr char_type* move(char_type* s1, const char_type* s2, size_t n);
-  static constexpr char_type* copy(char_type* s1, const char_type* s2, size_t n);
-  static constexpr char_type* assign(char_type* s, size_t n, char_type a);
+  static constexpr int compare(const char_type* s1, const char_type* s2, std::size_t n);
+  static constexpr std::size_t length(const char_type* s);
+  static constexpr const char_type* find(const char_type* s, std::size_t n, const char_type& a);
+  static constexpr char_type* move(char_type* s1, const char_type* s2, std::size_t n);
+  static constexpr char_type* copy(char_type* s1, const char_type* s2, std::size_t n);
+  static constexpr char_type* assign(char_type* s, std::size_t n, char_type a);
 
   static constexpr int_type not_eof(int_type c) noexcept { return eq_int_type(c, eof()) ? ~eof() : c; }
 
@@ -90,7 +91,7 @@ struct nasty_char_traits {
   static constexpr int_type eof() noexcept { return int_type(EOF); }
 };
 
-constexpr int nasty_char_traits::compare(const nasty_char* s1, const nasty_char* s2, size_t n) {
+constexpr int nasty_char_traits::compare(const nasty_char* s1, const nasty_char* s2, std::size_t n) {
   for (; n; --n, ++s1, ++s2) {
     if (lt(*s1, *s2))
       return -1;
@@ -100,14 +101,14 @@ constexpr int nasty_char_traits::compare(const nasty_char* s1, const nasty_char*
   return 0;
 }
 
-constexpr size_t nasty_char_traits::length(const nasty_char* s) {
-  size_t len = 0;
+constexpr std::size_t nasty_char_traits::length(const nasty_char* s) {
+  std::size_t len = 0;
   for (; !eq(*s, nasty_char(0)); ++s)
     ++len;
   return len;
 }
 
-constexpr const nasty_char* nasty_char_traits::find(const nasty_char* s, size_t n, const nasty_char& a) {
+constexpr const nasty_char* nasty_char_traits::find(const nasty_char* s, std::size_t n, const nasty_char& a) {
   for (; n; --n) {
     if (eq(*s, a))
       return s;
@@ -116,7 +117,7 @@ constexpr const nasty_char* nasty_char_traits::find(const nasty_char* s, size_t
   return 0;
 }
 
-constexpr nasty_char* nasty_char_traits::move(nasty_char* s1, const nasty_char* s2, size_t n) {
+constexpr nasty_char* nasty_char_traits::move(nasty_char* s1, const nasty_char* s2, std::size_t n) {
   nasty_char* r = s1;
   if (s1 < s2) {
     for (; n; --n, ++s1, ++s2)
@@ -130,7 +131,7 @@ constexpr nasty_char* nasty_char_traits::move(nasty_char* s1, const nasty_char*
   return r;
 }
 
-constexpr nasty_char* nasty_char_traits::copy(nasty_char* s1, const nasty_char* s2, size_t n) {
+constexpr nasty_char* nasty_char_traits::copy(nasty_char* s1, const nasty_char* s2, std::size_t n) {
   if (!std::is_constant_evaluated()) // fails in constexpr because we might be comparing unrelated pointers
     assert(s2 < s1 || s2 >= s1 + n);
   nasty_char* r = s1;
@@ -139,7 +140,7 @@ constexpr nasty_char* nasty_char_traits::copy(nasty_char* s1, const nasty_char*
   return r;
 }
 
-constexpr nasty_char* nasty_char_traits::assign(nasty_char* s, size_t n, nasty_char a) {
+constexpr nasty_char* nasty_char_traits::assign(nasty_char* s, std::size_t n, nasty_char a) {
   nasty_char* r = s;
   for (; n; --n, ++s)
     assign(*s, a);
@@ -148,7 +149,7 @@ constexpr nasty_char* nasty_char_traits::assign(nasty_char* s, size_t n, nasty_c
 
 using nasty_string = std::basic_string<nasty_char, nasty_char_traits>;
 
-template <size_t N>
+template <std::size_t N>
 struct ToNastyChar {
   constexpr ToNastyChar(const char (&r)[N]) {
     std::transform(r, r + N, std::addressof(text[0]), [](char c) { return nasty_char{c}; });
@@ -156,7 +157,7 @@ struct ToNastyChar {
   nasty_char text[N];
 };
 
-template <size_t N>
+template <std::size_t N>
 ToNastyChar(const char (&)[N]) -> ToNastyChar<N>;
 
 template <ToNastyChar t>

diff  --git a/libcxx/test/support/operator_hijacker.h b/libcxx/test/support/operator_hijacker.h
index 294d2e55879b7..a2569da0310ff 100644
--- a/libcxx/test/support/operator_hijacker.h
+++ b/libcxx/test/support/operator_hijacker.h
@@ -40,7 +40,7 @@ static_assert(std::is_trivially_copyable<operator_hijacker>::value &&     //
 
 template <>
 struct std::hash<operator_hijacker> {
-  size_t operator()(const operator_hijacker&) const { return 0; }
+  std::size_t operator()(const operator_hijacker&) const { return 0; }
 };
 
 #endif // SUPPORT_OPERATOR_HIJACKER_H

diff  --git a/libcxx/test/support/platform_support.h b/libcxx/test/support/platform_support.h
index 88ddf84eb20c9..ba14b32e3e94d 100644
--- a/libcxx/test/support/platform_support.h
+++ b/libcxx/test/support/platform_support.h
@@ -87,7 +87,7 @@ std::string get_temp_file_name()
 inline bool glibc_version_less_than(char const* version) {
   std::string test_version = std::string("glibc ") + version;
 
-  size_t n = confstr(_CS_GNU_LIBC_VERSION, nullptr, (size_t)0);
+  std::size_t n = confstr(_CS_GNU_LIBC_VERSION, nullptr, (size_t)0);
   char *current_version = new char[n];
   confstr(_CS_GNU_LIBC_VERSION, current_version, n);
 

diff  --git a/libcxx/test/support/poisoned_hash_helper.h b/libcxx/test/support/poisoned_hash_helper.h
index d37f3b356608a..000b08cd37beb 100644
--- a/libcxx/test/support/poisoned_hash_helper.h
+++ b/libcxx/test/support/poisoned_hash_helper.h
@@ -11,6 +11,7 @@
 #define SUPPORT_POISONED_HASH_HELPER_H
 
 #include <cassert>
+#include <cstddef>
 #include <type_traits>
 #include <utility>
 
@@ -117,7 +118,7 @@ struct ConvertibleTo {
 
 template <class Hasher, class Key, class Res = decltype(std::declval<Hasher&>()(std::declval<Key>()))>
 constexpr bool can_hash(int) {
-  return std::is_same<Res, size_t>::value;
+  return std::is_same<Res, std::size_t>::value;
 }
 template <class, class>
 constexpr bool can_hash(long) {

diff  --git a/libcxx/test/support/test.support/test_poisoned_hash_helper.pass.cpp b/libcxx/test/support/test.support/test_poisoned_hash_helper.pass.cpp
index f204fc33af14f..81450748b1a98 100644
--- a/libcxx/test/support/test.support/test_poisoned_hash_helper.pass.cpp
+++ b/libcxx/test/support/test.support/test_poisoned_hash_helper.pass.cpp
@@ -17,7 +17,7 @@
 
 #include "test_macros.h"
 
-template <class T, size_t = sizeof(T)>
+template <class T, std::size_t = sizeof(T)>
 constexpr bool is_complete_imp(int) { return true; }
 template <class> constexpr bool is_complete_imp(long) { return false; }
 template <class T> constexpr bool is_complete() { return is_complete_imp<T>(0); }

diff  --git a/libcxx/test/support/test_allocator.h b/libcxx/test/support/test_allocator.h
index c78224946236b..9330150a83851 100644
--- a/libcxx/test/support/test_allocator.h
+++ b/libcxx/test/support/test_allocator.h
@@ -405,7 +405,7 @@ class thread_unsafe_shared_ptr {
   struct control_block {
     template <class... Args>
     TEST_CONSTEXPR control_block(Args... args) : content(std::forward<Args>(args)...) {}
-    size_t ref_count = 1;
+    std::size_t ref_count = 1;
     T content;
   };
 

diff  --git a/libcxx/test/support/test_constexpr_container.h b/libcxx/test/support/test_constexpr_container.h
index 092f8b6b4e0e5..ca553be337946 100644
--- a/libcxx/test/support/test_constexpr_container.h
+++ b/libcxx/test/support/test_constexpr_container.h
@@ -14,6 +14,7 @@
 
 #include <algorithm>
 #include <cassert>
+#include <cstddef>
 #include <utility>
 
 #include "test_macros.h"
@@ -34,7 +35,7 @@ class ConstexprFixedCapacityDeque {
     constexpr iterator end() { return data_ + size_; }
     constexpr const_iterator begin() const { return data_; }
     constexpr const_iterator end() const { return data_ + size_; }
-    constexpr size_t size() const { return size_; }
+    constexpr std::size_t size() const { return size_; }
     constexpr const T& front() const { assert(size_ >= 1); return data_[0]; }
     constexpr const T& back() const { assert(size_ >= 1); return data_[size_-1]; }
 

diff  --git a/libcxx/test/support/test_memory_resource.h b/libcxx/test/support/test_memory_resource.h
index 1a0d722089ae2..280cdae1c619d 100644
--- a/libcxx/test/support/test_memory_resource.h
+++ b/libcxx/test/support/test_memory_resource.h
@@ -113,8 +113,8 @@ int TestResourceImp<Provider, N>::resource_destructed = 0;
 
 struct NullProvider {
     NullProvider() {}
-    void* allocate(size_t, size_t) { return nullptr; }
-    void deallocate(void*, size_t, size_t) {}
+    void* allocate(std::size_t, size_t) { return nullptr; }
+    void deallocate(void*, std::size_t, size_t) {}
     void reset() {}
 private:
     DISALLOW_COPY(NullProvider);
@@ -122,22 +122,22 @@ struct NullProvider {
 
 struct NewDeleteProvider {
     NewDeleteProvider() {}
-    void* allocate(size_t s, size_t) { return ::operator new(s); }
-    void deallocate(void* p, size_t, size_t) { ::operator delete(p); }
+    void* allocate(std::size_t s, size_t) { return ::operator new(s); }
+    void deallocate(void* p, std::size_t, size_t) { ::operator delete(p); }
     void reset() {}
 private:
     DISALLOW_COPY(NewDeleteProvider);
 };
 
-template <size_t Size = 4096 * 10> // 10 pages worth of memory.
+template <std::size_t Size = 4096 * 10> // 10 pages worth of memory.
 struct BufferProvider {
     char buffer[Size];
     void* next = &buffer;
-    size_t space = Size;
+    std::size_t space = Size;
 
     BufferProvider() {}
 
-    void* allocate(size_t s, size_t a) {
+    void* allocate(std::size_t s, size_t a) {
         void* ret = std::align(s, a, next, space);
         if (ret == nullptr) {
 #ifndef TEST_HAS_NO_EXCEPTIONS
@@ -150,7 +150,7 @@ struct BufferProvider {
         return ret;
     }
 
-    void deallocate(void*, size_t, size_t) {}
+    void deallocate(void*, std::size_t, size_t) {}
 
     void reset() {
         next = &buffer;

diff  --git a/libcxx/test/support/test_std_memory_resource.h b/libcxx/test/support/test_std_memory_resource.h
index b372c2731084e..f3923ae1d4d2f 100644
--- a/libcxx/test/support/test_std_memory_resource.h
+++ b/libcxx/test/support/test_std_memory_resource.h
@@ -105,14 +105,14 @@ int TestResourceImp<Provider, N>::resource_destructed = 0;
 
 struct NullProvider {
   NullProvider() {}
-  void* allocate(size_t, size_t) {
+  void* allocate(std::size_t, size_t) {
 #ifndef TEST_HAS_NO_EXCEPTIONS
     throw std::runtime_error("");
 #else
     std::abort();
 #endif
   }
-  void deallocate(void*, size_t, size_t) {}
+  void deallocate(void*, std::size_t, size_t) {}
   void reset() {}
 
 private:
@@ -121,23 +121,23 @@ struct NullProvider {
 
 struct NewDeleteProvider {
   NewDeleteProvider() {}
-  void* allocate(size_t s, size_t) { return ::operator new(s); }
-  void deallocate(void* p, size_t, size_t) { ::operator delete(p); }
+  void* allocate(std::size_t s, size_t) { return ::operator new(s); }
+  void deallocate(void* p, std::size_t, size_t) { ::operator delete(p); }
   void reset() {}
 
 private:
   DISALLOW_COPY(NewDeleteProvider);
 };
 
-template <size_t Size = 4096 * 10> // 10 pages worth of memory.
+template <std::size_t Size = 4096 * 10> // 10 pages worth of memory.
 struct BufferProvider {
   char buffer[Size];
   void* next   = &buffer;
-  size_t space = Size;
+  std::size_t space = Size;
 
   BufferProvider() {}
 
-  void* allocate(size_t s, size_t a) {
+  void* allocate(std::size_t s, size_t a) {
     void* ret = std::align(a, s, next, space);
     if (ret == nullptr) {
 #ifndef TEST_HAS_NO_EXCEPTIONS
@@ -150,7 +150,7 @@ struct BufferProvider {
     return ret;
   }
 
-  void deallocate(void*, size_t, size_t) {}
+  void deallocate(void*, std::size_t, size_t) {}
 
   void reset() {
     next  = &buffer;

diff  --git a/libcxx/test/support/uses_alloc_types.h b/libcxx/test/support/uses_alloc_types.h
index 94035726077e7..d4489ffc0fe5e 100644
--- a/libcxx/test/support/uses_alloc_types.h
+++ b/libcxx/test/support/uses_alloc_types.h
@@ -101,7 +101,7 @@ bool checkConstructionEquiv(TestType& T, TestType& U)
 ////////////////////////////////////////////////////////////////////////////////
 namespace detail {
 
-template <bool IsZero, size_t N, class ArgList, class ...Args>
+template <bool IsZero, std::size_t N, class ArgList, class ...Args>
 struct TakeNImp;
 
 template <class ArgList, class ...Args>
@@ -109,11 +109,11 @@ struct TakeNImp<true, 0, ArgList, Args...> {
   typedef ArgList type;
 };
 
-template <size_t N, class ...A1, class F, class ...R>
+template <std::size_t N, class ...A1, class F, class ...R>
 struct TakeNImp<false, N, ArgumentListID<A1...>, F, R...>
     : TakeNImp<N-1 == 0, N - 1, ArgumentListID<A1..., F>, R...> {};
 
-template <size_t N, class ...Args>
+template <std::size_t N, class ...Args>
 struct TakeNArgs : TakeNImp<N == 0, N, ArgumentListID<>, Args...> {};
 
 template <class T>
@@ -263,7 +263,7 @@ struct UsesAllocatorTestBase {
     UsesAllocatorTestBaseStorage<CtorAlloc> alloc_store;
 };
 
-template <class Alloc, size_t Arity>
+template <class Alloc, std::size_t Arity>
 class UsesAllocatorV1 : public UsesAllocatorTestBase<UsesAllocatorV1<Alloc, Arity>, Alloc>
 {
 public:
@@ -297,7 +297,7 @@ class UsesAllocatorV1 : public UsesAllocatorTestBase<UsesAllocatorV1<Alloc, Arit
 };
 
 
-template <class Alloc, size_t Arity>
+template <class Alloc, std::size_t Arity>
 class UsesAllocatorV2 : public UsesAllocatorTestBase<UsesAllocatorV2<Alloc, Arity>, Alloc>
 {
 public:
@@ -323,7 +323,7 @@ class UsesAllocatorV2 : public UsesAllocatorTestBase<UsesAllocatorV2<Alloc, Arit
     {}
 };
 
-template <class Alloc, size_t Arity>
+template <class Alloc, std::size_t Arity>
 class UsesAllocatorV3 : public UsesAllocatorTestBase<UsesAllocatorV3<Alloc, Arity>, Alloc>
 {
 public:
@@ -355,7 +355,7 @@ class UsesAllocatorV3 : public UsesAllocatorTestBase<UsesAllocatorV3<Alloc, Arit
     {}
 };
 
-template <class Alloc, size_t Arity>
+template <class Alloc, std::size_t Arity>
 class NotUsesAllocator : public UsesAllocatorTestBase<NotUsesAllocator<Alloc, Arity>, Alloc>
 {
 public:

diff  --git a/libcxx/utils/generate_extended_grapheme_cluster_test.py b/libcxx/utils/generate_extended_grapheme_cluster_test.py
index 94f669235a73b..6714b221b7789 100755
--- a/libcxx/utils/generate_extended_grapheme_cluster_test.py
+++ b/libcxx/utils/generate_extended_grapheme_cluster_test.py
@@ -169,7 +169,7 @@ def parseBreakTestLine(input: TextIO) -> Optional[BreakTestItem]:
   /// The offset of the last code units of the extended grapheme clusters in the input.
   ///
   /// The vector has the same number of entries as \\ref code_points.
-  std::vector<size_t> breaks;
+  std::vector<std::size_t> breaks;
 }};
 
 /// The data for UTF-8.


        


More information about the libcxx-commits mailing list