Allow copy elision in path concatenation

Summary:
Just port of libstdc++'s fix to libc++ fs: e6ac4004fe

Author of fix: Jonathan Wakely

Reviewers: EricWF, mclow.lists

Reviewed By: EricWF

Subscribers: smeenai, christof, cfe-commits, llvm-commits

Differential Revision: https://reviews.llvm.org/D46593

llvm-svn: 331910
This commit is contained in:
David Bolvansky 2018-05-09 18:57:17 +00:00
parent 762d498808
commit b89605db01
1 changed files with 3 additions and 1 deletions

View File

@ -1140,7 +1140,9 @@ bool operator>=(const path& __lhs, const path& __rhs) _NOEXCEPT
inline _LIBCPP_INLINE_VISIBILITY
path operator/(const path& __lhs, const path& __rhs) {
return path(__lhs) /= __rhs;
path __result(__lhs);
__result /= __rhs;
return __result;
}
template <class _Source>