diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-21 10:47:37 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-21 10:47:37 +0000 |
commit | 093b73d429f86581fe971a658ce5cb7dc3d248d5 (patch) | |
tree | 93d8d398d8d09efcd9f1f8a24bd57e5d7f5b95ff | |
parent | 644ac9c55e82057eba06c5afaa9a3c6a109796c2 (diff) | |
download | gcc-093b73d429f86581fe971a658ce5cb7dc3d248d5.tar.gz |
2011-11-21 Paolo Carlini <paolo.carlini@oracle.com>
* include/std/tuple (__conv_types, __one_by_one_convertible,
__all_convertible): Remove.
(tuple<>::tuple(_UElements&&...),
tuple<>::tuple(const tuple<_UElements...>&),
tuple<>::tuple(tuple<_UElements...>&&)): Remove wa for c++/48322.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181555 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | libstdc++-v3/ChangeLog | 8 | ||||
-rw-r--r-- | libstdc++-v3/include/std/tuple | 53 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/20_util/uses_allocator/cons_neg.cc | 2 |
3 files changed, 16 insertions, 47 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 336e77f8c0a..5d5fc1d7fc5 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2011-11-21 Paolo Carlini <paolo.carlini@oracle.com> + + * include/std/tuple (__conv_types, __one_by_one_convertible, + __all_convertible): Remove. + (tuple<>::tuple(_UElements&&...), + tuple<>::tuple(const tuple<_UElements...>&), + tuple<>::tuple(tuple<_UElements...>&&)): Remove wa for c++/48322. + 2011-11-20 Jason Merrill <jason@redhat.com> PR c++/48322 diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple index 474634fc24e..282d4509d3a 100644 --- a/libstdc++-v3/include/std/tuple +++ b/libstdc++-v3/include/std/tuple @@ -69,35 +69,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct __add_r_ref<_Tp&> { typedef _Tp& type; }; - // To work around c++/49225 aka c++/48322. - template<typename...> - struct __conv_types { }; - - template<typename _Tuple1, typename _Tuple2> - struct __one_by_one_convertible - : public false_type { }; - - template<typename _Tp, typename _Up> - struct __one_by_one_convertible<__conv_types<_Tp>, __conv_types<_Up>> - : public is_convertible<_Tp, _Up>::type { }; - - template<typename _T1, typename... _TR, typename _U1, typename... _UR> - struct __one_by_one_convertible<__conv_types<_T1, _TR...>, - __conv_types<_U1, _UR...>> - : public __and_<is_convertible<_T1, _U1>, - __one_by_one_convertible<__conv_types<_TR...>, - __conv_types<_UR...>>>::type - { }; - - template<typename _Tuple1, typename _Tuple2> - struct __all_convertible; - - template<typename... _TTypes, typename... _UTypes> - struct __all_convertible<__conv_types<_TTypes...>, - __conv_types<_UTypes...>> - : public __one_by_one_convertible<__conv_types<_TTypes...>, - __conv_types<_UTypes...>>::type { }; - template<std::size_t _Idx, typename _Head, bool _IsEmpty> struct _Head_base; @@ -407,13 +378,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION constexpr tuple(const _Elements&... __elements) : _Inherited(__elements...) { } - template<typename... _UElements, - typename = typename enable_if<sizeof...(_UElements) - == sizeof...(_Elements)>::type, - typename = typename - enable_if<__all_convertible<__conv_types<_UElements...>, - __conv_types<_Elements...> >::value - >::type> + template<typename... _UElements, typename = typename + enable_if<__and_<is_convertible<_UElements, + _Elements>...>::value>::type> explicit constexpr tuple(_UElements&&... __elements) : _Inherited(std::forward<_UElements>(__elements)...) { } @@ -423,21 +390,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION constexpr tuple(tuple&&) = default; template<typename... _UElements, typename = typename - enable_if<__and_<integral_constant<bool, sizeof...(_UElements) - == sizeof...(_Elements)>, - __all_convertible<__conv_types<const _UElements&...>, - __conv_types<_Elements...>> - >::value>::type> + enable_if<__and_<is_convertible<const _UElements&, + _Elements>...>::value>::type> constexpr tuple(const tuple<_UElements...>& __in) : _Inherited(static_cast<const _Tuple_impl<0, _UElements...>&>(__in)) { } template<typename... _UElements, typename = typename - enable_if<__and_<integral_constant<bool, sizeof...(_UElements) - == sizeof...(_Elements)>, - __all_convertible<__conv_types<_UElements...>, - __conv_types<_Elements...>> - >::value>::type> + enable_if<__and_<is_convertible<_UElements, + _Elements>...>::value>::type> constexpr tuple(tuple<_UElements...>&& __in) : _Inherited(static_cast<_Tuple_impl<0, _UElements...>&&>(__in)) { } diff --git a/libstdc++-v3/testsuite/20_util/uses_allocator/cons_neg.cc b/libstdc++-v3/testsuite/20_util/uses_allocator/cons_neg.cc index ad998356c83..73a0d0f7029 100644 --- a/libstdc++-v3/testsuite/20_util/uses_allocator/cons_neg.cc +++ b/libstdc++-v3/testsuite/20_util/uses_allocator/cons_neg.cc @@ -44,4 +44,4 @@ void test01() tuple<Type> t(allocator_arg, a, 1); } -// { dg-error "no matching function" "" { target *-*-* } 141 } +// { dg-error "no matching function" "" { target *-*-* } 112 } |