[libcxx-commits] [PATCH] D149696: [libc++] Add missing test for std::hash<std::filesystem::path>
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu May 4 07:38:11 PDT 2023
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGefc494aa4d84: [libc++] Add missing test for std::hash<std::filesystem::path> (authored by ldionne).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D149696/new/
https://reviews.llvm.org/D149696
Files:
libcxx/include/module.modulemap.in
libcxx/test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp
libcxx/test/std/input.output/filesystems/class.path/path.member/path.hash_enabled.pass.cpp
Index: libcxx/test/std/input.output/filesystems/class.path/path.member/path.hash_enabled.pass.cpp
===================================================================
--- /dev/null
+++ libcxx/test/std/input.output/filesystems/class.path/path.member/path.hash_enabled.pass.cpp
@@ -0,0 +1,24 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03
+
+// <filesystem>
+
+// Test that <filesystem> provides all of the arithmetic, enum, and pointer
+// hash specializations.
+
+#include "filesystem_include.h"
+#include "poisoned_hash_helper.h"
+
+int main(int, char**) {
+ test_library_hash_specializations_available();
+ test_hash_enabled_for_type<fs::path>();
+
+ return 0;
+}
Index: libcxx/test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp
===================================================================
--- libcxx/test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp
+++ libcxx/test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp
@@ -25,6 +25,7 @@
// strong_ordering operator<=>(path const&, path const&) noexcept;
//
// size_t hash_value(path const&) noexcept;
+// template<> struct hash<filesystem::path>;
#include "filesystem_include.h"
#include <type_traits>
Index: libcxx/include/module.modulemap.in
===================================================================
--- libcxx/include/module.modulemap.in
+++ libcxx/include/module.modulemap.in
@@ -877,7 +877,11 @@
module file_type { private header "__filesystem/file_type.h" }
module filesystem_error { private header "__filesystem/filesystem_error.h" }
module operations { private header "__filesystem/operations.h" }
- module path { private header "__filesystem/path.h" }
+ module path {
+ private header "__filesystem/path.h"
+ export functional.__functional.hash
+ export functional.__functional.unary_function
+ }
module path_iterator { private header "__filesystem/path_iterator.h" }
module perm_options { private header "__filesystem/perm_options.h" }
module perms { private header "__filesystem/perms.h" }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149696.519485.patch
Type: text/x-patch
Size: 2644 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230504/e3924b7e/attachment.bin>
More information about the libcxx-commits
mailing list