diff options
| author | Casey Carter <Casey@Carter.net> | 2019-10-12 19:01:46 +0000 | 
|---|---|---|
| committer | Casey Carter <Casey@Carter.net> | 2019-10-12 19:01:46 +0000 | 
| commit | e198823b87b20c8dacb1bc950e9c44f1ce46f702 (patch) | |
| tree | 3bf53ff5b79f82f6130530d044db11913a52b4e2 /libcxx/test/std/utilities/optional | |
| parent | 3049748e15b76465ad21e1d68c48fc1dcf7def09 (diff) | |
| download | bcm5719-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.cpp | 2 | 
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");      } | 

