-
Notifications
You must be signed in to change notification settings - Fork 144
Open
Description
Starting with GCC15 ( when using -WConversion ) I get conversion warnings when using stream operator in custom failure messages.
Example code from the docs also produces those warnings:
#define BOOST_TEST_MODULE boost_test_message
#include <boost/test/included/unit_test.hpp>
BOOST_AUTO_TEST_CASE( test_message )
{
const int a(1), b(2);
BOOST_TEST(a == b, "a should be equal to b: " << a << "!=" << b);
BOOST_TEST(a != 10, "value of a=" << a);
}
Warning:
<source>: In member function 'void test_message::test_method()':
<source>:8:62: warning: choosing 'boost::test_tools::tt_detail::assertion_evaluate_t<E>::operator boost::test_tools::assertion_result() [with E = boost::test_tools::assertion::binary_expr<boost::test_tools::assertion::value_expr<const int&>, const int&, boost::test_tools::assertion::op::EQ<int, int, void> >]' over 'boost::test_tools::assertion_result::assertion_result(const BoolConvertable&) [with BoolConvertable = boost::test_tools::tt_detail::assertion_evaluate_t<boost::test_tools::assertion::binary_expr<boost::test_tools::assertion::value_expr<const int&>, const int&, boost::test_tools::assertion::op::EQ<int, int, void> > >]' [-Wconversion]
8 | BOOST_TEST(a == b, "a should be equal to b: " << a << "!=" << b);
| ^
<source>:8:62: warning: for conversion from 'boost::test_tools::tt_detail::assertion_evaluate_t<boost::test_tools::assertion::binary_expr<boost::test_tools::assertion::value_expr<const int&>, const int&, boost::test_tools::assertion::op::EQ<int, int, void> > >' to 'boost::test_tools::assertion_result' [-Wconversion]
<source>:8:62: note: because conversion sequence for the argument is better
Metadata
Metadata
Assignees
Labels
No labels