[libc++][test] Make some string tests MSVC-friendly
authorCasey Carter <Casey@Carter.net>
Mon, 9 Jan 2023 05:58:56 +0000 (21:58 -0800)
committerCasey Carter <Casey@Carter.net>
Mon, 9 Jan 2023 23:00:07 +0000 (15:00 -0800)
commit6b90f6745ac78933baf2d56b1f32c274a52c2ec0
tree914cf1339d71783cd31c72f7096d172e094c05ec
parent9f4a9d3f44501fa755eb71fe855e15cf0e59e8b8
[libc++][test] Make some string tests MSVC-friendly

* Using one-or-two letter names for globals is asking for shadowing warnings.
* MSVCSTL's container proxy allocations strike again
* MSVCSTL's `<string>` doesn't define `std::out_of_range`
* `basic_string::substr` takes two arguments of type `size_type`. Let's use that type instead of `size_t` and `ptrdiff_t` to avoid narrowing warnings.

Differential Revision: https://reviews.llvm.org/D141253
libcxx/test/std/strings/basic.string/string.cons/dtor.pass.cpp
libcxx/test/std/strings/basic.string/string.ops/string_substr/substr_rvalue.pass.cpp