[libcxx-commits] [PATCH] D100866: [WIP] Add a buildkite for _LIBCPP_DEBUG=1.

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 21 09:02:01 PDT 2021


Quuxplusone added inline comments.


================
Comment at: libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_hint_const_lvalue.pass.cpp:38
     const VT v2(3.5, 4);
-    r = c.insert(c.end(), v2);
+    r = c.insert(r, v2);
     assert(c.size() == 1);
----------------
curdeius wrote:
> What's the reason for this and similar changes?
[libc++] [test] Stop using invalid iterators to insert into sets/maps. (Applies [4c80bfbd53caf](https://github.com/llvm/llvm-project/commit/4c80bfbd53cafa3690ba5c65459cf6cfc560e2e3) consistently across associative and unord tests.)
```
    [libc++] [test] Stop using invalid iterators to insert into sets/maps.
    
    This simply applies Howard's commit 4c80bfbd53caf consistently
    across all the associative and unordered container tests.
    
    "unord.set/insert_hint_const_lvalue.pass.cpp" failed with `-D_LIBCPP_DEBUG=1`
    before this patch; it was the only one that incorrectly reused
    invalid iterator `e`. The others already used valid iterators
    (generally `c.end()`); I'm just making them all match the same pattern
    of usage: "e, then r, then c.end() for the rest."
```


================
Comment at: libcxx/test/std/containers/unord/unord.set/insert_hint_const_lvalue.pass.cpp:36
 
-    r = c.insert(e, v1);
+    r = c.insert(r, v1);
     assert(c.size() == 1);
----------------
(@curdeius : Here's the one where the test was actually using an invalidated iterator `e`.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100866



More information about the libcxx-commits mailing list