summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/optional
diff options
context:
space:
mode:
authorCasey Carter <Casey@Carter.net>2019-10-12 19:01:46 +0000
committerCasey Carter <Casey@Carter.net>2019-10-12 19:01:46 +0000
commite198823b87b20c8dacb1bc950e9c44f1ce46f702 (patch)
tree3bf53ff5b79f82f6130530d044db11913a52b4e2 /libcxx/test/std/utilities/optional
parent3049748e15b76465ad21e1d68c48fc1dcf7def09 (diff)
downloadbcm5719-llvm-e198823b87b20c8dacb1bc950e9c44f1ce46f702.tar.gz
bcm5719-llvm-e198823b87b20c8dacb1bc950e9c44f1ce46f702.zip
[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`). llvm-svn: 374684
Diffstat (limited to 'libcxx/test/std/utilities/optional')
-rw-r--r--libcxx/test/std/utilities/optional/optional.specalg/make_optional_explicit.pass.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libcxx/test/std/utilities/optional/optional.specalg/make_optional_explicit.pass.cpp b/libcxx/test/std/utilities/optional/optional.specalg/make_optional_explicit.pass.cpp
index e736eb4a355..3a9aec86d50 100644
--- a/libcxx/test/std/utilities/optional/optional.specalg/make_optional_explicit.pass.cpp
+++ b/libcxx/test/std/utilities/optional/optional.specalg/make_optional_explicit.pass.cpp
@@ -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");
}
OpenPOWER on IntegriCloud