From 18337e990bfa83997dc145496754bfb039ad4fa6 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Sun, 12 Sep 2021 22:35:44 +0300 Subject: [PATCH] Disable zip_iterator test with std::tuple on gcc 4.4. libstdc++ from gcc 4.4 has a broken std::tuple that fails to compile a constructor from a compatible tuple: /usr/include/c++/4.4/tuple: In constructor 'std::_Head_base<_Idx, _Head, false>::_Head_base(_UHead&&) [with _UHead = std::_Head_base<0ul, const int&, false>, long unsigned int _Idx = 0ul, _Head = int]': /usr/include/c++/4.4/tuple:179: instantiated from 'std::_Tuple_impl<_Idx, _Head, _Tail ...>::_Tuple_impl(std::_Tuple_impl<_Idx, _UElements ...>&&) [with _UElements = const int&, double&, long unsigned int _Idx = 0ul, _Head = int, _Tail = double]' /usr/include/c++/4.4/tuple:338: instantiated from 'std::tuple<_T1, _T2>::tuple(std::tuple<_U1, _U2>&&) [with _U1 = const int&, _U2 = double&, _T1 = int, _T2 = double]' libs/iterator/test/detail/zip_iterator_test_original.ipp:137: instantiated from here /usr/include/c++/4.4/tuple:94: error: cannot convert 'std::_Head_base<0ul, const int&, false>' to 'int' in initialization --- test/zip_iterator_test2_std_tuple.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/zip_iterator_test2_std_tuple.cpp b/test/zip_iterator_test2_std_tuple.cpp index 95eff87..91d7748 100644 --- a/test/zip_iterator_test2_std_tuple.cpp +++ b/test/zip_iterator_test2_std_tuple.cpp @@ -1,6 +1,9 @@ #include -#if !defined(BOOST_NO_CXX11_HDR_TUPLE) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) +// libstdc++ from gcc 4.4 has a broken std::tuple that cannot be constructed from a compatible tuple, +// e.g. std::tuple from std::tuple. +#if !defined(BOOST_NO_CXX11_HDR_TUPLE) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && \ + (!defined(BOOST_LIBSTDCXX_VERSION) || BOOST_LIBSTDCXX_VERSION >= 40500) #include #include @@ -14,8 +17,8 @@ #else int main() - { - return 0; - } +{ + return 0; +} #endif