Implement P0513R0, Poisoning the Hash.
authorVille Voutilainen <ville.voutilainen@gmail.com>
Mon, 14 Nov 2016 21:22:53 +0000 (23:22 +0200)
committerVille Voutilainen <ville@gcc.gnu.org>
Mon, 14 Nov 2016 21:22:53 +0000 (23:22 +0200)
commit6964bb3ed962554b18ca92633b5395f91f9bebac
treee1d2145486a1b5d3d50527b9b06b360d834db452
parent627a2f592382c96daaa3bce4a22245f0614892d0
Implement P0513R0, Poisoning the Hash.

* include/bits/functional_hash.h (__poison_hash): New.
* include/bits/unique_ptr.h
(hash<unique_ptr<_Tp, _Dp>>): Derive from __poison_hash.
* include/std/optional (hash<optional<_Tp>>): Likewise.
* include/std/variant (hash<variant<_Types...>>): Likewise.
* testsuite/20_util/default_delete/48631_neg.cc: Adjust.
* testsuite/20_util/default_delete/void_neg.cc: Likewise.
* testsuite/20_util/optional/hash.cc: New.
* testsuite/20_util/unique_ptr/assign/48635_neg.cc: Adjust.
* testsuite/20_util/unique_ptr/cons/cv_qual_neg.cc: Adjust.
* testsuite/20_util/unique_ptr/hash/1.cc: Add tests for
poisoned fancy pointer hashes.
* testsuite/20_util/variant/hash.cc: New.

From-SVN: r242402
12 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/functional_hash.h
libstdc++-v3/include/bits/unique_ptr.h
libstdc++-v3/include/std/optional
libstdc++-v3/include/std/variant
libstdc++-v3/testsuite/20_util/default_delete/48631_neg.cc
libstdc++-v3/testsuite/20_util/default_delete/void_neg.cc
libstdc++-v3/testsuite/20_util/optional/hash.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/unique_ptr/assign/48635_neg.cc
libstdc++-v3/testsuite/20_util/unique_ptr/cons/cv_qual_neg.cc
libstdc++-v3/testsuite/20_util/unique_ptr/hash/1.cc
libstdc++-v3/testsuite/20_util/variant/hash.cc [new file with mode: 0644]