[PATCH] Proposed fix for PR22806

Marshall Clow mclow.lists at gmail.com
Thu Mar 5 10:48:38 PST 2015


Hi ldionne, EricWF, K-ballo,

In the single-argument case, `tuple_cat` of an rvalue tuple appears to move from, destroy, and then move from the argument again.

Provide a degenerate implementation for the single-argument case.

http://reviews.llvm.org/D8084

Files:
  include/tuple

Index: include/tuple
===================================================================
--- include/tuple
+++ include/tuple
@@ -1117,6 +1117,14 @@
                                             _VSTD::forward<_Tuples>(__tpls)...);
 }
 
+template <class _Tuple>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+typename __tuple_cat_return<_Tuple>::type
+tuple_cat(_Tuple&& __t0)
+{
+    return __t0;
+}
+
 template <class ..._Tp, class _Alloc>
 struct _LIBCPP_TYPE_VIS_ONLY uses_allocator<tuple<_Tp...>, _Alloc>
     : true_type {};

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8084.21288.patch
Type: text/x-patch
Size: 547 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150305/0196cdb7/attachment.bin>


More information about the cfe-commits mailing list