[PATCH] D46593: Allow copy elision in path concatenation

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 8 11:28:06 PDT 2018


xbolva00 created this revision.
xbolva00 added a reviewer: EricWF.
Herald added a subscriber: llvm-commits.

Just port of libstdc++'s fix to libc++ fs: https://github.com/gcc-mirror/gcc/commit/e6ac4004fe49d785c63bf87aec4b095b5ce1d19f

Author of fix: Jonathan Wakely


Repository:
  rL LLVM

https://reviews.llvm.org/D46593

Files:
  filesystem


Index: filesystem
===================================================================
--- filesystem
+++ filesystem
@@ -1140,7 +1140,9 @@
 
 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>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46593.145736.patch
Type: text/x-patch
Size: 368 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180508/43501c66/attachment.bin>


More information about the llvm-commits mailing list