<div dir="ltr">On Sat, Oct 5, 2013 at 11:46 AM, Marshall Clow <span dir="ltr"><<a href="mailto:mclow.lists@gmail.com" target="_blank">mclow.lists@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: marshall<br>
Date: Sat Oct  5 13:46:37 2013<br>
New Revision: 192038<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=192038&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=192038&view=rev</a><br>
Log:<br>
Implement LWG issue 2275 'forward_as_tuple should be constexpr'<br></blockquote><div><br></div><div>Does LWG have a distinction between a DR (applies to previous standards) and an extension (only applies to new standard), like CWG does? Or do I have to #define something extra to get C++11 plus LWG-approved bug fixes?</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Modified:<br>
    libcxx/trunk/include/tuple<br>
    libcxx/trunk/test/utilities/tuple/tuple.tuple/tuple.creation/forward_as_tuple.pass.cpp<br>
<br>
Modified: libcxx/trunk/include/tuple<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/tuple?rev=192038&r1=192037&r2=192038&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/tuple?rev=192038&r1=192037&r2=192038&view=diff</a><br>

==============================================================================<br>
--- libcxx/trunk/include/tuple (original)<br>
+++ libcxx/trunk/include/tuple Sat Oct  5 13:46:37 2013<br>
@@ -73,7 +73,7 @@ public:<br>
 const unspecified ignore;<br>
<br>
 template <class... T> tuple<V...>  make_tuple(T&&...); // constexpr in C++14<br>
-template <class... T> tuple<ATypes...> forward_as_tuple(T&&...) noexcept;<br>
+template <class... T> tuple<ATypes...> forward_as_tuple(T&&...) noexcept; // constexpr in C++14<br>
 template <class... T> tuple<T&...> tie(T&...) noexcept;<br>
 template <class... Tuples> tuple<CTypes...> tuple_cat(Tuples&&... tpls); // constexpr in C++14<br>
<br>
@@ -833,14 +833,6 @@ make_tuple(_Tp&&... __t)<br>
 template <class... _Tp><br>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11<br>
 tuple<_Tp&&...><br>
-__forward_as_tuple(_Tp&&... __t) _NOEXCEPT<br>
-{<br>
-    return tuple<_Tp&&...>(_VSTD::forward<_Tp>(__t)...);<br>
-}<br>
-<br>
-template <class... _Tp><br>
-inline _LIBCPP_INLINE_VISIBILITY<br>
-tuple<_Tp&&...><br>
 forward_as_tuple(_Tp&&... __t) _NOEXCEPT<br>
 {<br>
     return tuple<_Tp&&...>(_VSTD::forward<_Tp>(__t)...);<br>
@@ -1041,7 +1033,7 @@ struct __tuple_cat<tuple<_Types...>, __t<br>
     typename __tuple_cat_return_ref<tuple<_Types...>&&, _Tuple0&&>::type<br>
     operator()(tuple<_Types...> __t, _Tuple0&& __t0)<br>
     {<br>
-        return __forward_as_tuple(_VSTD::forward<_Types>(get<_I0>(__t))...,<br>
+        return forward_as_tuple(_VSTD::forward<_Types>(get<_I0>(__t))...,<br>
                                       get<_J0>(_VSTD::forward<_Tuple0>(__t0))...);<br>
     }<br>
<br>
@@ -1056,7 +1048,7 @@ struct __tuple_cat<tuple<_Types...>, __t<br>
            tuple<_Types..., typename __apply_cv<_Tuple0, typename tuple_element<_J0, _T0>::type>::type&&...>,<br>
            typename __make_tuple_indices<sizeof ...(_Types) + tuple_size<_T0>::value>::type,<br>
            typename __make_tuple_indices<tuple_size<_T1>::value>::type>()<br>
-                           (__forward_as_tuple(<br>
+                           (forward_as_tuple(<br>
                               _VSTD::forward<_Types>(get<_I0>(__t))...,<br>
                               get<_J0>(_VSTD::forward<_Tuple0>(__t0))...<br>
                             ),<br>
<br>
Modified: libcxx/trunk/test/utilities/tuple/tuple.tuple/tuple.creation/forward_as_tuple.pass.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/tuple/tuple.tuple/tuple.creation/forward_as_tuple.pass.cpp?rev=192038&r1=192037&r2=192038&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/tuple/tuple.tuple/tuple.creation/forward_as_tuple.pass.cpp?rev=192038&r1=192037&r2=192038&view=diff</a><br>

==============================================================================<br>
--- libcxx/trunk/test/utilities/tuple/tuple.tuple/tuple.creation/forward_as_tuple.pass.cpp (original)<br>
+++ libcxx/trunk/test/utilities/tuple/tuple.tuple/tuple.creation/forward_as_tuple.pass.cpp Sat Oct  5 13:46:37 2013<br>
@@ -51,6 +51,15 @@ test2a(const Tuple& t)<br>
     assert(std::get<1>(t) == 'a');<br>
 }<br>
<br>
+#if _LIBCPP_STD_VER > 11<br>
+template <class Tuple><br>
+constexpr int<br>
+test3(const Tuple& t)<br>
+{<br>
+    return std::tuple_size<Tuple>::value;<br>
+}<br>
+#endif<br>
+<br>
 int main()<br>
 {<br>
     {<br>
@@ -67,5 +76,8 @@ int main()<br>
         double i = 2.5;<br>
         char c = 'a';<br>
         test2a(std::forward_as_tuple(i, c));<br>
+#if _LIBCPP_STD_VER > 11<br>
+        static_assert ( test3 (std::forward_as_tuple(i, c)) == 2, "" );<br>
+#endif<br>
     }<br>
 }<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div>