libstdc++: Value-initialize objects held by EBO helpers [PR 100863]
authorJonathan Wakely <jwakely@redhat.com>
Wed, 2 Jun 2021 11:34:48 +0000 (12:34 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 2 Jun 2021 12:33:41 +0000 (13:33 +0100)
commitf8f0193b5b83f6e85d65015e79c803295baf5166
tree8657a3e30e0510caacd21163196d3098385b0e23
parent81eab204a56dcd8acb1ca5d7df277437ca07b51a
libstdc++: Value-initialize objects held by EBO helpers [PR 100863]

The allocator, hash function and equality function should all be
value-initialized by the default constructor of an unordered container.
Do it in the EBO helper, so we don't have to get it right in multiple
places.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

PR libstdc++/100863
PR libstdc++/65816
* include/bits/hashtable_policy.h (_Hashtable_ebo_helper):
Value-initialize subobject.
* testsuite/23_containers/unordered_map/allocator/default_init.cc:
Remove XFAIL.
* testsuite/23_containers/unordered_set/allocator/default_init.cc:
Remove XFAIL.
libstdc++-v3/include/bits/hashtable_policy.h
libstdc++-v3/testsuite/23_containers/unordered_map/allocator/default_init.cc
libstdc++-v3/testsuite/23_containers/unordered_set/allocator/default_init.cc