[Bug libstdc++/89608] Undetected iterator invalidations on unordered containers in debug mode

Jonathan Wakely jwakely@redhat.com
Thu Mar 7 23:57:00 GMT 2019


On 07/03/19 22:22 +0100, François Dumont wrote:
>Hi
>
>    I consider the implementation to decide to invalidate iterators or 
>not. As nodes are not deallocated and only slghtly impacted during the 
>rehash process I consider that they shouldn't be invalidated appart 
>from the local iterators. I should have just consider the Standard.
>
>    Here is the complete patch which is Max Sistemich proposal but 
>extended to the other unordered containers with also the test adapted 
>for the testsuite.
>
>PR libstdc++/89608
>* include/debug/unordered_map (unordered_map<>::_M_check_rehashed):
>  Invalidate all iterators in case of rehash.
>  (unordered_multimap<>::_M_check_rehashed): Likewise.
>* include/debug/unordered_set (unordered_set<>::_M_check_rehashed):
>   Likewise.
>   (unordered_multiset<>::_M_check_rehashed): Likewise.
>
>* testsuite/23_containers/unordered_set/debug/89608_neg.cc: New.
>
>    I run all unordered tests so far in Debug mode. I have 4 unrelated 
>failures that I'll fix through another patch. Ok to commit once all 
>tests run ?

Yes, this is OK for trunk, thanks!



More information about the Libstdc++ mailing list