[libcxx-commits] [libcxx] cb2648e - [libcxx] [test] Use a string_view of the native path type in the concat test
Martin Storsjö via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Mar 11 09:35:27 PST 2021
Author: Martin Storsjö
Date: 2021-03-11T19:34:58+02:00
New Revision: cb2648e6f0fbed25ffbb6cb5d9b76d46f39001aa
URL: https://github.com/llvm/llvm-project/commit/cb2648e6f0fbed25ffbb6cb5d9b76d46f39001aa
DIFF: https://github.com/llvm/llvm-project/commit/cb2648e6f0fbed25ffbb6cb5d9b76d46f39001aa.diff
LOG: [libcxx] [test] Use a string_view of the native path type in the concat test
This makes sure that no extra allocations happen on windows, fixing
earlier errors in the DisableAllocationGuard (in the second case that
is modified).
This is split out from D98398.
Differential Revision: https://reviews.llvm.org/D98406
Added:
Modified:
libcxx/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp
Removed:
################################################################################
diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp
index 8d02be832d22..6ad1817a3a50 100644
--- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp
@@ -341,7 +341,7 @@ int main(int, char**)
}
{
path LHS((const char*)TC.lhs);
- std::string_view RHS((const char*)TC.rhs);
+ std::basic_string_view<path::value_type> RHS((const path::value_type*)TC.rhs);
path& Ref = (LHS += RHS);
assert(LHS == (const char*)TC.expect);
assert(&Ref == &LHS);
@@ -367,7 +367,7 @@ int main(int, char**)
}
{
path LHS((const char*)TC.lhs);
- std::string_view RHS((const char*)TC.rhs);
+ std::basic_string_view<path::value_type> RHS((const path::value_type*)TC.rhs);
const char* E = TC.expect;
PathReserve(LHS, StrLen(E) + 5);
{
More information about the libcxx-commits
mailing list