]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Fix non-default constructors for hash containers [PR101583]
authorJonathan Wakely <jwakely@redhat.com>
Thu, 22 Jul 2021 17:49:57 +0000 (18:49 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 22 Jul 2021 18:39:58 +0000 (19:39 +0100)
commit8ed6cfbbee74ec9e03f2558b9c36f61dd7d4dcfd
tree88604566e9bb0d802e9554ecad85c88cbeb060a3
parentb362d7947b37059fdb6de62145fa5146258dd58f
libstdc++: Fix non-default constructors for hash containers [PR101583]

When I added the new mixin to _Hashtable, I forgot to explicitly
construct it in each non-default constructor. That means you can't
use any constructors unless all three of the hash function, equality
function, and allocator are all default constructible.

libstdc++-v3/ChangeLog:

PR libstdc++/101583
* include/bits/hashtable.h (_Hashtable): Replace mixin with
_Enable_default_ctor. Construct it explicitly in all
non-forwarding, non-defaulted constructors.
* testsuite/23_containers/unordered_map/cons/default.cc: Check
non-default constructors can be used.
* testsuite/23_containers/unordered_set/cons/default.cc:
Likewise.
libstdc++-v3/include/bits/hashtable.h
libstdc++-v3/testsuite/23_containers/unordered_map/cons/default.cc
libstdc++-v3/testsuite/23_containers/unordered_set/cons/default.cc