id summary reporter owner description type status milestone component version severity resolution keywords cc 12778 Boost.Test is broken against left shift operator in certain cases anonymous Raffi Enficiaud "{{{ BOOST_CHECK_EQUAL(nullptr, nullptr); }}} results in {{{ /usr/include/boost/type_traits/detail/has_binary_operator.hpp: In instantiation of ‘const bool boost::detail::has_left_shift_impl::operator_exists, std::nullptr_t>::value’: /usr/include/boost/type_traits/detail/has_binary_operator.hpp:179:4: required from ‘const bool boost::detail::has_left_shift_impl::trait_impl1, std::nullptr_t, boost::detail::has_left_shift_impl::dont_care, false>::value’ /usr/include/boost/type_traits/detail/has_binary_operator.hpp:208:4: required from ‘const bool boost::detail::has_left_shift_impl::trait_impl, std::nullptr_t, boost::detail::has_left_shift_impl::dont_care>::value’ /usr/include/boost/type_traits/detail/has_binary_operator.hpp:216:8: required from ‘struct boost::has_left_shift, std::nullptr_t, boost::detail::has_left_shift_impl::dont_care>’ /usr/include/boost/test/tools/detail/print_helper.hpp:47:5: required from ‘struct boost::test_tools::tt_detail::print_log_value’ /usr/include/boost/test/tools/detail/print_helper.hpp:178:5: required from ‘std::ostream& boost::test_tools::tt_detail::operator<<(std::ostream&, const boost::test_tools::tt_detail::print_helper_t&) [with T = std::nullptr_t; std::ostream = std::basic_ostream]’ /usr/include/boost/test/tools/assertion.hpp:163:1: required from ‘static void boost::test_tools::assertion::op::EQ::report(std::ostream&, const PrevExprType&, const Rhs&) [with PrevExprType = boost::test_tools::assertion::value_expr&>; Lhs = firewall::deep_const_ptr; Rhs = std::nullptr_t; Enabler = void; std::ostream = std::basic_ostream]’ /usr/include/boost/test/tools/assertion.hpp:355:26: required from ‘void boost::test_tools::assertion::binary_expr::report(std::ostream&) const [with LExpr = boost::test_tools::assertion::value_expr&>; Rhs = std::nullptr_t; OP = boost::test_tools::assertion::op::EQ, std::nullptr_t, void>; std::ostream = std::basic_ostream]’ /usr/include/boost/test/tools/assertion.hpp:365:15: required from ‘boost::test_tools::assertion_result boost::test_tools::assertion::binary_expr::evaluate(bool) const [with LExpr = boost::test_tools::assertion::value_expr&>; Rhs = std::nullptr_t; OP = boost::test_tools::assertion::op::EQ, std::nullptr_t, void>]’ /usr/include/boost/type_traits/detail/has_binary_operator.hpp:158:70: error: ambiguous overload for ‘operator<<’ (operand types are ‘std::basic_ostream’ and ‘std::nullptr_t’) BOOST_STATIC_CONSTANT(bool, value = (sizeof(s_check(((make() BOOST_TT_TRAIT_OP make()),make())))==sizeof(::boost::type_traits::yes_type))); }}} no matter what I try to alleviate it, including: {{{ #define BOOST_TEST_NO_OLD_TOOLS }}} {{{ BOOST_TEST_DONT_PRINT_LOG_VALUE(::std::nullptr_t) }}} {{{ template inline ::std::basic_ostream& operator<<(::std::basic_ostream& os, std::nullptr_t const&) { return os; } }}} {{{ namespace boost { namespace test_tools { namespace tt_detail { template inline ::std::basic_ostream& operator<<(::std::basic_ostream& os, std::nullptr_t const&) { return os; } } // namespace tt_detail } // namespace test_tools } // namespace boost }}} {{{ namespace my_namespace { template inline ::std::basic_ostream& operator<<(::std::basic_ostream& os, std::nullptr_t const&) { return os; } } // namespace my_namespace }}} etc., etc., etc. I also cannot understand what's the problem. I mean theoretically it should work but it does not. Furthermore, I've discovered another problem. Doing {{{ #define BOOST_TEST_NO_OLD_TOOLS }}} and then {{{ ::std::ofstream ofs(""xxx""); BOOST_REQUIRE(ofs); }}} results in {{{ /usr/include/boost/test/utils/wrap_stringstream.hpp: In instantiation of ‘boost::basic_wrap_stringstream& boost::operator<<(boost::basic_wrap_stringstream&, const T&) [with CharT = char; T = std::basic_ofstream]’: /usr/include/boost/test/tools/assertion.hpp:312:93: required from ‘static void boost::test_tools::assertion::value_expr::format_message(boost::wrap_stringstream&, const U&) [with U = std::basic_ofstream; T = std::basic_ofstream&; boost::wrap_stringstream = boost::basic_wrap_stringstream]’ /usr/include/boost/test/tools/assertion.hpp:305:23: required from ‘boost::test_tools::assertion_result boost::test_tools::assertion::value_expr::evaluate(bool) const [with T = std::basic_ofstream&]’ /usr/include/boost/test/utils/wrap_stringstream.hpp:66:19: error: no match for ‘operator<<’ (operand types are ‘boost::basic_wrap_stringstream::wrapped_stream {aka std::__cxx11::basic_ostringstream}’ and ‘const std::basic_ofstream’) targ.stream() << t; /usr/include/boost/test/utils/wrap_stringstream.hpp:66:19: note: candidate: operator<<(int, int) /usr/include/boost/test/utils/wrap_stringstream.hpp:66:19: note: no known conversion for argument 2 from ‘const std::basic_ofstream’ to ‘int’ In file included from /usr/include/c++/6.2.1/iterator:64:0, from ../../include/process/args.hpp:42, from ../../include/process/args:35, from /home/aks/Projects/Bitbucket/Process/Source/test/source/process/stdi.t.cpp:38: /usr/include/c++/6.2.1/ostream:108:7: note: candidate: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__ostream_type& (*)(std::basic_ostream<_CharT, _Traits>::__ostream_type&)) [with _CharT = char; _Traits = std::char_traits; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream] operator<<(__ostream_type& (*__pf)(__ostream_type&)) }}} and the workaround it of course {{{ BOOST_REQUIRE(bool(ofs)); }}} which is a no go in the long run. Looking forward to your assistance. Regards." Bugs closed Boost 1.64.0 test Boost 1.63.0 Showstopper fixed