[libcxx] r179467 - Accidentally disallowed explicit tuple conversions when all elements of the tuple can be explicitly converted.

Howard Hinnant hhinnant at apple.com
Sat Apr 13 17:01:13 PDT 2013


Author: hhinnant
Date: Sat Apr 13 19:01:13 2013
New Revision: 179467

URL: http://llvm.org/viewvc/llvm-project?rev=179467&view=rev
Log:
Accidentally disallowed explicit tuple conversions when all elements of the tuple can be explicitly converted.

Modified:
    libcxx/trunk/include/tuple
    libcxx/trunk/test/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp

Modified: libcxx/trunk/include/tuple
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/tuple?rev=179467&r1=179466&r2=179467&view=diff
==============================================================================
--- libcxx/trunk/include/tuple (original)
+++ libcxx/trunk/include/tuple Sat Apr 13 19:01:13 2013
@@ -477,7 +477,7 @@ struct __tuple_impl<__tuple_indices<_Ind
     template <class _Tuple,
               class = typename enable_if
                       <
-                         __tuple_convertible<_Tuple, tuple<_Tp...> >::value
+                         __tuple_constructible<_Tuple, tuple<_Tp...> >::value
                       >::type
              >
         _LIBCPP_INLINE_VISIBILITY

Modified: libcxx/trunk/test/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp?rev=179467&r1=179466&r2=179467&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp (original)
+++ libcxx/trunk/test/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp Sat Apr 13 19:01:13 2013
@@ -67,4 +67,13 @@ int main()
         assert(std::get<1>(t1) == int('a'));
         assert(std::get<2>(t1).id_ == 2);
     }
+    {
+        typedef std::tuple<double, char, int> T0;
+        typedef std::tuple<int, int, B> T1;
+        T0 t0(2.5, 'a', 3);
+        T1 t1(t0);
+        assert(std::get<0>(t1) == 2);
+        assert(std::get<1>(t1) == int('a'));
+        assert(std::get<2>(t1).id_ == 3);
+    }
 }





More information about the cfe-commits mailing list