[libcxx-commits] [libcxx] [libc++][test] Make `deallocate_size.pass.cpp` MSVC-friendly (PR #165162)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 28 18:44:11 PDT 2025


================
@@ -64,14 +65,14 @@ struct test_alloc {
 
 template <class Sz>
 void test() {
+  using Str = std::basic_string<char, std::char_traits<char>, test_alloc<char, Sz> >;
   for (int i = 1; i < 1000; ++i) {
-    using Str = std::basic_string<char, std::char_traits<char>, test_alloc<char, Sz> >;
     {
       Str s(i, 't');
-      assert(allocated_ == 0 || allocated_ >= i);
+      (void)s;
----------------
frederick-vs-ja wrote:

It seems that we don't use `[[maybe_unused]]` when the test needs to run before C++17. I'm trying to introduce a `TEST_MAYBE_UNUSED` macro.

https://github.com/llvm/llvm-project/pull/165162


More information about the libcxx-commits mailing list