[libcxx-commits] [libcxx] [libc++] fix back slash as root dir breaks lexically_relative, lexically_proximate and hash_value on Windows (PR #99780)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Aug 5 12:41:16 PDT 2024
================
@@ -368,7 +368,8 @@ size_t hash_value(const path& __p) noexcept {
size_t hash_value = 0;
hash<string_view_t> hasher;
while (PP) {
- hash_value = __hash_combine(hash_value, hasher(*PP));
+ string_view_t Part = PP.inRootDir() ? PATHSTR("/") : *PP;
----------------
ldionne wrote:
So IIUC you canonicalize `<DRIVE>:/` to just `/` for the purpose of `hash_value`?
https://github.com/llvm/llvm-project/pull/99780
More information about the libcxx-commits
mailing list