This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] [test] Use a string_view of the native path type in the concat test
ClosedPublic

Authored by mstorsjo on Mar 11 2021, 3:13 AM.

Details

Summary

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.

Diff Detail

Event Timeline

mstorsjo requested review of this revision.Mar 11 2021, 3:13 AM
mstorsjo created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptMar 11 2021, 3:13 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Quuxplusone added a subscriber: Quuxplusone.

LGTM, although this pre-existing "manually type-cast to a pointer type to trigger the appropriate operator X*()" technique is hecka confusing. I would be tempted to give class MultiStringView some additional member function templates for sanity's sake: TC.rhs.as_string_view<path::value_type>() and perhaps TC.rhs.as_cstr<path::value_type>().

curdeius accepted this revision.Mar 11 2021, 9:07 AM
curdeius added a subscriber: curdeius.

LGTM.
I like Arthur's idea of not using operatorX*()... just saying :).

This revision is now accepted and ready to land.Mar 11 2021, 9:07 AM