aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2019-05-10 22:41:16 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2019-05-10 22:41:16 +0100
commit7fb65a875956bac7095c17c545f2bfa131209f50 (patch)
tree0d945d627e2583d50ac319f8f646456033b25a85 /gcc
parent302b6996078bca83fbb51e7b77bce9fbb4e8072b (diff)
downloadgcc-7fb65a875956bac7095c17c545f2bfa131209f50.zip
gcc-7fb65a875956bac7095c17c545f2bfa131209f50.tar.gz
gcc-7fb65a875956bac7095c17c545f2bfa131209f50.tar.bz2
PR libstdc++/90388 fix std::hash<unique_ptr<T,D>> bugs
A disabled specialization should not be callable, so move the function call operator into a new base class which correctly implements the disabled hash semantics. For the versioned namespace configuration do not derive from __poison_hash in the enabled case, as the empty base class serves no purpose but potentially increases the object size. For the default configuration that base class must be kept, to preserve layout. An enabled specialization should not be unconditionally noexcept, because the underlying hash object might throw. PR libstdc++/90388 * include/bits/unique_ptr.h (default_delete, default_delete<T[]>): Use _Require for constraints. (operator>(nullptr_t, const unique_ptr<T,D>&)): Implement exactly as per the standard. (__uniq_ptr_hash): New base class with conditionally-disabled call operator. (hash<unique_ptr<T,D>>): Derive from __uniq_ptr_hash. * testsuite/20_util/default_delete/48631_neg.cc: Adjust dg-error line. * testsuite/20_util/unique_ptr/hash/90388.cc: New test. From-SVN: r271078
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions