diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2021-07-20 15:20:41 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2021-07-20 16:22:26 +0100 |
commit | 89ec3b67dbe856a447d068b053bc19559f136f43 (patch) | |
tree | 095bc49b129d27b0523b87be0e941583a56a020e /libstdc++-v3/src/filesystem/ops.cc | |
parent | 1ef9b135793a528c05c4a3e22649744955aa2dfb (diff) | |
download | gcc-89ec3b67dbe856a447d068b053bc19559f136f43.zip gcc-89ec3b67dbe856a447d068b053bc19559f136f43.tar.gz gcc-89ec3b67dbe856a447d068b053bc19559f136f43.tar.bz2 |
libstdc++: fix is_default_constructible for hash containers [PR 100863]
The recent change to _Hashtable_ebo_helper for this PR broke the
is_default_constructible trait for a hash container with a non-default
constructible allocator. That happens because the constructor needs to
be user-provided in order to initialize the member, and so is not
defined as deleted when the type is not default constructible.
By making _Hashtable derive from _Enable_special_members we can ensure
that the default constructor for the std::unordered_xxx containers is
deleted when it would be ill-formed. This makes the trait give the
correct answer.
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:
PR libstdc++/100863
* include/bits/hashtable.h (_Hashtable): Conditionally delete
default constructor by deriving from _Enable_special_members.
* testsuite/23_containers/unordered_map/cons/default.cc: New test.
* testsuite/23_containers/unordered_set/cons/default.cc: New test.
Diffstat (limited to 'libstdc++-v3/src/filesystem/ops.cc')
0 files changed, 0 insertions, 0 deletions