[libcxx-commits] [libcxx] 8b828e9 - [libcxx][test] Silence MSVC signed-to-unsigned implicit conversion warnings

Casey Carter via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 12 14:55:16 PDT 2020


Author: Casey Carter
Date: 2020-06-12T14:54:51-07:00
New Revision: 8b828e983868d5b26f3e7de9e4dc68e27d5bf28c

URL: https://github.com/llvm/llvm-project/commit/8b828e983868d5b26f3e7de9e4dc68e27d5bf28c
DIFF: https://github.com/llvm/llvm-project/commit/8b828e983868d5b26f3e7de9e4dc68e27d5bf28c.diff

LOG: [libcxx][test] Silence MSVC signed-to-unsigned implicit conversion warnings

Added: 
    

Modified: 
    libcxx/test/std/containers/sequences/array/at.pass.cpp
    libcxx/test/std/containers/sequences/array/at_const.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/containers/sequences/array/at.pass.cpp b/libcxx/test/std/containers/sequences/array/at.pass.cpp
index ed4ab80fb0cd..77474d6090e2 100644
--- a/libcxx/test/std/containers/sequences/array/at.pass.cpp
+++ b/libcxx/test/std/containers/sequences/array/at.pass.cpp
@@ -77,7 +77,8 @@ void test_exceptions()
         }
 
         try {
-            TEST_IGNORE_NODISCARD array.at(-1);
+            using size_type = decltype(array)::size_type;
+            TEST_IGNORE_NODISCARD array.at(static_cast<size_type>(-1));
             assert(false);
         } catch (std::out_of_range const&) {
             // pass

diff  --git a/libcxx/test/std/containers/sequences/array/at_const.pass.cpp b/libcxx/test/std/containers/sequences/array/at_const.pass.cpp
index d79c5054ae83..b8d6b4c24c12 100644
--- a/libcxx/test/std/containers/sequences/array/at_const.pass.cpp
+++ b/libcxx/test/std/containers/sequences/array/at_const.pass.cpp
@@ -73,7 +73,8 @@ void test_exceptions()
         }
 
         try {
-            TEST_IGNORE_NODISCARD array.at(-1);
+            using size_type = decltype(array)::size_type;
+            TEST_IGNORE_NODISCARD array.at(static_cast<size_type>(-1));
             assert(false);
         } catch (std::out_of_range const&) {
             // pass


        


More information about the libcxx-commits mailing list