[libc++][test] Silence MSVC warning in std::optional test

`make_optional<string>(4, 'X')` passes `4` (an `int`) as the first argument to `string`'s `(size_t, charT)` constructor, triggering a signed/unsigned mismatch warning when compiling with MSVC at `/W4`. The incredibly simple fix is to instead use an unsigned literal (`4u`).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374684 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Casey Carter 2019-10-12 19:01:46 +00:00
parent 437d5a5dcf
commit 1f4cad9f28

View File

@ -40,7 +40,7 @@ int main(int, char**)
assert(s == nullptr);
}
{
auto opt = make_optional<std::string>(4, 'X');
auto opt = make_optional<std::string>(4u, 'X');
assert(*opt == "XXXX");
}