[libcxx-commits] [PATCH] D91178: [22/N] [libcxx] Implement append and operator/ properly for windows

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Dec 11 11:47:52 PST 2020


mstorsjo added inline comments.


================
Comment at: libcxx/include/filesystem:1033
+    __pn_ += __p.__pn_.substr(__p_root_name_size);
+    return *this;
+  }
----------------
amccarth wrote:
> The above looks like a literal translation of the standard, so I'd expected it to be platform agnostic.  What makes it Windows-specific?
It's fairly close to the reference yes. It's not very windows specific in itself, but libc++'s current posix-only implementation is much more straightforward due to having less complicated rules (where there's no root name concept at all).


================
Comment at: libcxx/test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp:97
+      , {S("//host/"), S("foo"),      S("//host/foo")}
+      , {S("//host"),  S(""),         S("//host/")}
+
----------------
amccarth wrote:
> The three UNC examples above exactly match those in the `#ifdef _WIN32` branch, so perhaps they should be hoisted above the ifdef.
Sure, I guess they can be hoisted.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91178/new/

https://reviews.llvm.org/D91178



More information about the libcxx-commits mailing list