diff options
author | Howard Hinnant <hhinnant@apple.com> | 2013-04-14 00:01:13 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2013-04-14 00:01:13 +0000 |
commit | f3b02b17af0794a0a354cbd48c91abd4f3463d1e (patch) | |
tree | fba61cc7a081936704816e4263624577e2736eac /libcxx | |
parent | 9594f4c8183ec59f8c9e35620fe52540060eb8aa (diff) | |
download | bcm5719-llvm-f3b02b17af0794a0a354cbd48c91abd4f3463d1e.tar.gz bcm5719-llvm-f3b02b17af0794a0a354cbd48c91abd4f3463d1e.zip |
Accidentally disallowed explicit tuple conversions when all elements of the tuple can be explicitly converted.
llvm-svn: 179467
Diffstat (limited to 'libcxx')
-rw-r--r-- | libcxx/include/tuple | 2 | ||||
-rw-r--r-- | libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/libcxx/include/tuple b/libcxx/include/tuple index 7f299e9da28..0df315e2aa4 100644 --- a/libcxx/include/tuple +++ b/libcxx/include/tuple @@ -477,7 +477,7 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...> template <class _Tuple, class = typename enable_if < - __tuple_convertible<_Tuple, tuple<_Tp...> >::value + __tuple_constructible<_Tuple, tuple<_Tp...> >::value >::type > _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp index 60ebd93aba7..33aed89b073 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp @@ -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); + } } |