[libcxx-commits] [PATCH] D91138: [6/N] [libcxx] Handle backslash as path separator on windows

Adrian McCarthy via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Dec 1 14:56:13 PST 2020


amccarth added inline comments.


================
Comment at: libcxx/include/filesystem:1122
+#if defined(_LIBCPP_WIN32API)
+    std::replace(__pn_.begin(), __pn_.end(), '/', '\\');
+#endif
----------------
1.  It looks like most places are using `preferred_separator`, so is there a ever case where you'd have slashes instead of backslashes?

2.  If I've read correctly, the Windows version always uses wide characters, so maybe the character literals should be `L'/'` and `L'\\'` so that they naturally match the value type of the iterator.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91138



More information about the libcxx-commits mailing list