summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/27_io/filesystem/path
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2022-04-25 18:21:57 +0100
committerJonathan Wakely <jwakely@redhat.com>2022-04-26 13:22:18 +0100
commite3c5e8360b4e4799e1e2daf74282629248690f23 (patch)
treec94078d6f0d97a5f3a344518eee9c7e49899c470 /libstdc++-v3/testsuite/27_io/filesystem/path
parentad56a60f58c1ed662deaf60d5736c332ec2caabb (diff)
libstdc++: Define std::hash<std::filesystem::path> (LWG 3657)
This DR was approved at the February 2022 plenary. libstdc++-v3/ChangeLog: * include/bits/fs_path.h (hash<filesystem::path>): Define. * testsuite/27_io/filesystem/path/nonmember/hash_value.cc: Check std::hash specialization.
Diffstat (limited to 'libstdc++-v3/testsuite/27_io/filesystem/path')
-rw-r--r--libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/hash_value.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/hash_value.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/hash_value.cc
index 6bc6296b5a8..0dcea6efc64 100644
--- a/libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/hash_value.cc
+++ b/libstdc++-v3/testsuite/27_io/filesystem/path/nonmember/hash_value.cc
@@ -42,9 +42,19 @@ test02()
}
}
+void
+test03()
+{
+ std::hash<path> h;
+ // LWG 3657. std::hash<std::filesystem::path> is not enabled
+ for (const path p : __gnu_test::test_paths)
+ VERIFY( h(p) == hash_value(p) );
+}
+
int
main()
{
test01();
test02();
+ test03();
}