HomePhabricator

Mark some of the behavior in the move w/allocator constructors of…

Description

Mark some of the behavior in the move w/allocator constructors of deque/unordered containers as 'libc++-specific'. Thanks to Andrey Maksimov for pointing this out.

Details

Committed
marshallJan 29 2019, 8:12 AM
Branches
Unknown
Tags
Unknown

Event Timeline

amakc11 added inline comments.
/libcxx/trunk/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp
181

This line seems to require change also. If the moved object m1 is empty after the move operation completes, then this assert is fine. Otherwise, 3 more allocations will happen during move. So, this line should look, for example, like this:

assert(Counter_base::gConstructed == num+6+(m1.empty()?0:3));
185

This line should look like this:

assert(Counter_base::gConstructed == num+6+(m1.empty()?0:3)+(m2.empty()?0:3));
189

This line should look like this:

assert(Counter_base::gConstructed == num+3+(m1.empty()?0:3)+(m2.empty()?0:3));