[libcxx] r298581 - Worked around GCC bug 56480. Explicit specialization in a different namespace.
Michael Park via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 22 23:21:24 PDT 2017
Author: mpark
Date: Thu Mar 23 01:21:24 2017
New Revision: 298581
URL: http://llvm.org/viewvc/llvm-project?rev=298581&view=rev
Log:
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
Modified:
libcxx/trunk/test/std/utilities/optional/optional.hash/hash.pass.cpp
libcxx/trunk/test/std/utilities/variant/variant.hash/hash.pass.cpp
Modified: libcxx/trunk/test/std/utilities/optional/optional.hash/hash.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/optional/optional.hash/hash.pass.cpp?rev=298581&r1=298580&r2=298581&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/optional/optional.hash/hash.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/optional/optional.hash/hash.pass.cpp Thu Mar 23 01:21:24 2017
@@ -22,11 +22,15 @@
struct A {};
struct B {};
+namespace std {
+
template <>
-struct std::hash<B> {
+struct hash<B> {
size_t operator()(B const&) { return 0; }
};
+}
+
int main()
{
using std::optional;
Modified: libcxx/trunk/test/std/utilities/variant/variant.hash/hash.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/variant/variant.hash/hash.pass.cpp?rev=298581&r1=298580&r2=298581&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/variant/variant.hash/hash.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/variant/variant.hash/hash.pass.cpp Thu Mar 23 01:21:24 2017
@@ -125,13 +125,17 @@ void test_hash_variant_duplicate_element
struct A {};
struct B {};
+namespace std {
+
template <>
-struct std::hash<B> {
+struct hash<B> {
size_t operator()(B const&) const {
return 0;
}
};
+}
+
void test_hash_variant_enabled() {
{
test_hash_enabled_for_type<std::variant<int> >();
More information about the cfe-commits
mailing list