[libcxx-commits] [libcxx] bcb917e - [libc++][test] Fix more MSVC warnings (#74256)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Dec 6 05:52:54 PST 2023


Author: Stephan T. Lavavej
Date: 2023-12-06T08:52:50-05:00
New Revision: bcb917eba70b454a3d11010c45889c364fd4d9ec

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

LOG: [libc++][test] Fix more MSVC warnings (#74256)

Found while running libc++'s test suite with MSVC's STL.

Added: 
    

Modified: 
    libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/member_swap_noexcept.pass.cpp
    libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/nonmember_swap_noexcept.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.filter/iterator/arrow.pass.cpp
    libcxx/test/std/ranges/range.factories/range.repeat.view/size.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/member_swap_noexcept.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/member_swap_noexcept.pass.cpp
index cdb09df7c7a9a..0a0128e44658f 100644
--- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/member_swap_noexcept.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/member_swap_noexcept.pass.cpp
@@ -27,7 +27,7 @@ struct test_alloc {
   using value_type = T;
 
   [[nodiscard]] constexpr T* allocate(std::size_t) { return nullptr; }
-  void deallocate(void*, unsigned) {}
+  void deallocate(void*, std::size_t) {}
 };
 
 template <class T>

diff  --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/nonmember_swap_noexcept.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/nonmember_swap_noexcept.pass.cpp
index fdefc5ebe9af0..4f41e3a4d716a 100644
--- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/nonmember_swap_noexcept.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/nonmember_swap_noexcept.pass.cpp
@@ -26,7 +26,7 @@ struct test_alloc {
   using value_type = T;
 
   [[nodiscard]] constexpr T* allocate(std::size_t) { return nullptr; }
-  void deallocate(void*, unsigned) {}
+  void deallocate(void*, std::size_t) {}
 };
 
 template <class T>

diff  --git a/libcxx/test/std/ranges/range.adaptors/range.filter/iterator/arrow.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.filter/iterator/arrow.pass.cpp
index f139226b875f0..0c02cfdb76ad3 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.filter/iterator/arrow.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.filter/iterator/arrow.pass.cpp
@@ -59,7 +59,7 @@ struct WithNonCopyableIterator : std::ranges::view_base {
     iterator(iterator&&);
     iterator& operator=(iterator&&);
     XYPoint& operator*() const;
-    iterator operator->() const;
+    XYPoint* operator->() const;
     iterator& operator++();
     iterator operator++(int);
 

diff  --git a/libcxx/test/std/ranges/range.factories/range.repeat.view/size.pass.cpp b/libcxx/test/std/ranges/range.factories/range.repeat.view/size.pass.cpp
index 72531b059aa24..6f24b3b9bf75a 100644
--- a/libcxx/test/std/ranges/range.factories/range.repeat.view/size.pass.cpp
+++ b/libcxx/test/std/ranges/range.factories/range.repeat.view/size.pass.cpp
@@ -31,8 +31,9 @@ constexpr bool test() {
   }
 
   {
-    std::ranges::repeat_view<int, int> rv(10, std::numeric_limits<int>::max());
-    assert(rv.size() == std::numeric_limits<int>::max());
+    constexpr int int_max = std::numeric_limits<int>::max();
+    std::ranges::repeat_view<int, int> rv(10, int_max);
+    assert(rv.size() == int_max);
   }
 
   return true;


        


More information about the libcxx-commits mailing list