[libcxx-commits] [libcxx] [libc++][C++03] Cherry-pick #166690 (PR #198977)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Thu May 21 00:53:25 PDT 2026


https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/198977

None

>From 8d0f988584e5d98983029cf47c2cd1cefaf9aee0 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser at berlin.de>
Date: Thu, 21 May 2026 09:37:17 +0200
Subject: [PATCH] [libc++][C++03] Cherry-pick #166690

---
 libcxx/include/__cxx03/__functional/hash.h                   | 5 +++++
 .../utilities/function.objects/unord.hash/pointer.pass.cpp   | 2 --
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/libcxx/include/__cxx03/__functional/hash.h b/libcxx/include/__cxx03/__functional/hash.h
index b2c3bee1c75bf..37fb035e51b6b 100644
--- a/libcxx/include/__cxx03/__functional/hash.h
+++ b/libcxx/include/__cxx03/__functional/hash.h
@@ -504,6 +504,11 @@ struct _LIBCPP_TEMPLATE_VIS __enum_hash<_Tp, false> {
 template <class _Tp>
 struct _LIBCPP_TEMPLATE_VIS hash : public __enum_hash<_Tp> {};
 
+template <>
+struct hash<nullptr_t> : public __unary_function<nullptr_t, size_t> {
+  _LIBCPP_HIDE_FROM_ABI size_t operator()(nullptr_t) const _NOEXCEPT { return 662607004ull; }
+};
+
 _LIBCPP_END_NAMESPACE_STD
 
 #endif // _LIBCPP___CXX03___FUNCTIONAL_HASH_H
diff --git a/libcxx/test/std/utilities/function.objects/unord.hash/pointer.pass.cpp b/libcxx/test/std/utilities/function.objects/unord.hash/pointer.pass.cpp
index ce331e59ffdb5..784831018a006 100644
--- a/libcxx/test/std/utilities/function.objects/unord.hash/pointer.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/unord.hash/pointer.pass.cpp
@@ -17,8 +17,6 @@
 //     size_t operator()(T val) const;
 // };
 
-// XFAIL: FROZEN-CXX03-HEADERS-FIXME
-
 // Not very portable
 
 #include <cassert>



More information about the libcxx-commits mailing list