re PR libstdc++/87135 ([C++17] unordered containers violate iterator validity require...
authorFrançois Dumont <fdumont@gcc.gnu.org>
Tue, 18 Sep 2018 20:36:16 +0000 (20:36 +0000)
committerFrançois Dumont <fdumont@gcc.gnu.org>
Tue, 18 Sep 2018 20:36:16 +0000 (20:36 +0000)
commita521e62615e439aea7502a52fd0f8a21eaa6304f
tree0d8e691c655254cfc40fc4d1416b1a47c34e35bb
parent998511a6100212931d039e3a46403d2d878c8e5a
re PR libstdc++/87135 ([C++17] unordered containers violate iterator validity requirements)

2018-09-18  François Dumont  <fdumont@gcc.gnu.org>

PR libstdc++/87135
* src/c++11/hashtable_c++0x.cc:
(_Prime_rehash_policy::_M_next_bkt): Return a prime no smaller than
requested size, but not necessarily greater.
(_Prime_rehash_policy::_M_need_rehash): Rehash only if target size is
strictly greater than next resize threshold.
* testsuite/23_containers/unordered_map/modifiers/reserve.cc: Adapt test
to validate that there is no rehash as long as number of insertion is
lower or equal to the reserved number of elements.

From-SVN: r264413
libstdc++-v3/ChangeLog
libstdc++-v3/src/c++11/hashtable_c++0x.cc
libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/reserve.cc