Bläddra i källkod

[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
Casey Carter 5 år sedan
förälder
incheckning
1f4cad9f28

+ 1 - 1
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");
     }