[libc++] Implement P1989R2: range constructor for string_view
Implement P1989R2 which adds a range constructor for `string_view`.
Adjust `operator/=` in `path` to avoid atomic constraints caching issue
getting provoked from this PR.
Add defaulted template argument to `string_view`'s "sufficient
overloads" to avoid mangling issues in `clang-cl` builds. It is a
MSVC mangling bug that this works around.
Differential Revision: https://reviews.llvm.org/D113161
NOKEYCHECK=True
GitOrigin-RevId: c16b13ebf97753a84cb7062c4c1ac984851de4b9
diff --git a/include/filesystem b/include/filesystem
index c688ab7..39e8ca2 100644
--- a/include/filesystem
+++ b/include/filesystem
@@ -1033,7 +1033,7 @@
auto __p_root_name = __p.__root_name();
auto __p_root_name_size = __p_root_name.size();
if (__p.is_absolute() ||
- (!__p_root_name.empty() && __p_root_name != root_name())) {
+ (!__p_root_name.empty() && __p_root_name != __string_view(root_name().__pn_))) {
__pn_ = __p.__pn_;
return *this;
}