[libcxx-commits] [libcxx] [libc++][C++03] Cherry-pick #166690 (PR #198977)
via libcxx-commits
libcxx-commits at lists.llvm.org
Thu May 21 01:43:00 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: Nikolas Klauser (philnik777)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/198977.diff
2 Files Affected:
- (modified) libcxx/include/__cxx03/__functional/hash.h (+5)
- (modified) libcxx/test/std/utilities/function.objects/unord.hash/pointer.pass.cpp (-2)
``````````diff
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>
``````````
</details>
https://github.com/llvm/llvm-project/pull/198977
More information about the libcxx-commits
mailing list