From ad3680b23e99b1266c61282c216ae454aded1d10 Mon Sep 17 00:00:00 2001 From: Michael Park Date: Thu, 23 Mar 2017 06:21:24 +0000 Subject: [PATCH] Worked around GCC bug 56480. Explicit specialization in a different namespace. Summary: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480 Reviewers: EricWF Reviewed By: EricWF Differential Revision: https://reviews.llvm.org/D31273 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@298581 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/std/utilities/optional/optional.hash/hash.pass.cpp | 6 +++++- test/std/utilities/variant/variant.hash/hash.pass.cpp | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/test/std/utilities/optional/optional.hash/hash.pass.cpp b/test/std/utilities/optional/optional.hash/hash.pass.cpp index 8f94d6be6..1e4088190 100644 --- a/test/std/utilities/optional/optional.hash/hash.pass.cpp +++ b/test/std/utilities/optional/optional.hash/hash.pass.cpp @@ -22,11 +22,15 @@ struct A {}; struct B {}; +namespace std { + template <> -struct std::hash { +struct hash { size_t operator()(B const&) { return 0; } }; +} + int main() { using std::optional; diff --git a/test/std/utilities/variant/variant.hash/hash.pass.cpp b/test/std/utilities/variant/variant.hash/hash.pass.cpp index 840084fe8..2ad2184f4 100644 --- a/test/std/utilities/variant/variant.hash/hash.pass.cpp +++ b/test/std/utilities/variant/variant.hash/hash.pass.cpp @@ -125,13 +125,17 @@ void test_hash_variant_duplicate_elements() { struct A {}; struct B {}; +namespace std { + template <> -struct std::hash { +struct hash { size_t operator()(B const&) const { return 0; } }; +} + void test_hash_variant_enabled() { { test_hash_enabled_for_type >();