From 967e3ac2f0c13a9ac945ce3e62160c0d6995beb9 Mon Sep 17 00:00:00 2001 From: Deniz Bahadir Date: Thu, 3 Sep 2020 12:46:32 +0200 Subject: [PATCH] Fix errors due to non-explicit conversions of tribool to bool --- include/boost/test/tools/assertion_result.hpp | 2 +- include/boost/test/tools/old/interface.hpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/boost/test/tools/assertion_result.hpp b/include/boost/test/tools/assertion_result.hpp index 85eea741f7..73b2361717 100644 --- a/include/boost/test/tools/assertion_result.hpp +++ b/include/boost/test/tools/assertion_result.hpp @@ -54,7 +54,7 @@ class BOOST_TEST_DECL assertion_result { {} template - assertion_result( BoolConvertable const& pv_ ) : p_predicate_value( !!pv_ ) {} + assertion_result( BoolConvertable const& pv_ ) : p_predicate_value( !!static_cast(pv_) ) {} // Access methods bool operator!() const { return !p_predicate_value; } diff --git a/include/boost/test/tools/old/interface.hpp b/include/boost/test/tools/old/interface.hpp index 1b23c291a3..7f0d4d40ba 100644 --- a/include/boost/test/tools/old/interface.hpp +++ b/include/boost/test/tools/old/interface.hpp @@ -78,17 +78,17 @@ do { //____________________________________________________________________________// #define BOOST_WARN( P ) BOOST_TEST_TOOL_IMPL( 2, \ - (P), BOOST_TEST_STRINGIZE( P ), WARN, CHECK_PRED, _ ) + static_cast(P), BOOST_TEST_STRINGIZE( P ), WARN, CHECK_PRED, _ ) #define BOOST_CHECK( P ) BOOST_TEST_TOOL_IMPL( 2, \ - (P), BOOST_TEST_STRINGIZE( P ), CHECK, CHECK_PRED, _ ) + static_cast(P), BOOST_TEST_STRINGIZE( P ), CHECK, CHECK_PRED, _ ) #define BOOST_REQUIRE( P ) BOOST_TEST_TOOL_IMPL( 2, \ - (P), BOOST_TEST_STRINGIZE( P ), REQUIRE, CHECK_PRED, _ ) + static_cast(P), BOOST_TEST_STRINGIZE( P ), REQUIRE, CHECK_PRED, _ ) //____________________________________________________________________________// -#define BOOST_WARN_MESSAGE( P, M ) BOOST_TEST_TOOL_IMPL( 2, (P), M, WARN, CHECK_MSG, _ ) -#define BOOST_CHECK_MESSAGE( P, M ) BOOST_TEST_TOOL_IMPL( 2, (P), M, CHECK, CHECK_MSG, _ ) -#define BOOST_REQUIRE_MESSAGE( P, M ) BOOST_TEST_TOOL_IMPL( 2, (P), M, REQUIRE, CHECK_MSG, _ ) +#define BOOST_WARN_MESSAGE( P, M ) BOOST_TEST_TOOL_IMPL( 2, static_cast(P), M, WARN, CHECK_MSG, _ ) +#define BOOST_CHECK_MESSAGE( P, M ) BOOST_TEST_TOOL_IMPL( 2, static_cast(P), M, CHECK, CHECK_MSG, _ ) +#define BOOST_REQUIRE_MESSAGE( P, M ) BOOST_TEST_TOOL_IMPL( 2, static_cast(P), M, REQUIRE, CHECK_MSG, _ ) //____________________________________________________________________________//