[libcxx-commits] [PATCH] D57903: [libcxx] Add missing checks to tests for the move w/allocator constructors of associative containers.

Andrey Maksimov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 12 13:07:48 PST 2019


amakc11 added inline comments.


================
Comment at: test/std/containers/associative/map/map.cons/move_alloc.pass.cpp:181
             LIBCPP_ASSERT(m1.empty());
-            assert(Counter_base::gConstructed == num+6);
+            assert(Counter_base::gConstructed == num+6+(m1.empty()?0:3));
 
----------------
ldionne wrote:
> Technically, I think the container could also have just 2 elements remaining, no? IOW, what you mean is really that `num+6 <= Counter_base::gConstructed <= num+6+3`?
This assumption looks very strange to me. The `std::move()` either deletes everything in the source container or preserves everything. Any intermediate solution when this function deletes any random(??) number of elements looks unreasonable. However, if you have any specific reasons for implementing (and testing) such intermediate solution, please, provide them. Please, also consult Marshall who is the author of these tests.


Repository:
  rCXX libc++

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57903/new/

https://reviews.llvm.org/D57903





More information about the libcxx-commits mailing list