From 17bfac0875cb6b656232113a2daabd828a0815ab Mon Sep 17 00:00:00 2001 From: Norbert Wenzel Date: Tue, 7 Mar 2017 18:27:36 +0100 Subject: [PATCH 1/2] Silence MSVC unreachable code warning (/W4) --- include/boost/test/impl/execution_monitor.ipp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/test/impl/execution_monitor.ipp b/include/boost/test/impl/execution_monitor.ipp index 0c5690ca89..08e61ae04d 100644 --- a/include/boost/test/impl/execution_monitor.ipp +++ b/include/boost/test/impl/execution_monitor.ipp @@ -1287,7 +1287,7 @@ execution_monitor::execute( boost::function const& F ) #endif // !BOOST_NO_EXCEPTIONS - return 0; // never reached; supplied to quiet compiler warnings + BOOST_UNREACHABLE_RETURN(0); // never reached; supplied to quiet compiler warnings } // execute //____________________________________________________________________________// From 6ce144c86f527e8fbd3c8af675e41be3e2d3baf5 Mon Sep 17 00:00:00 2001 From: Norbert Wenzel Date: Thu, 8 Jun 2017 21:01:42 +0200 Subject: [PATCH 2/2] Silence MSVC unreachable code warning (/W4) --- include/boost/test/utils/named_params.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/boost/test/utils/named_params.hpp b/include/boost/test/utils/named_params.hpp index 88b8a883fe..4aa01681eb 100644 --- a/include/boost/test/utils/named_params.hpp +++ b/include/boost/test/utils/named_params.hpp @@ -131,23 +131,23 @@ struct nil { #else operator T const&() const #endif - { nfp_detail::report_access_to_invalid_parameter(true); static T* v = 0; return *v; } + { nfp_detail::report_access_to_invalid_parameter(true); static T* v = 0; BOOST_UNREACHABLE_RETURN(*v); } template T any_cast() const - { nfp_detail::report_access_to_invalid_parameter(true); static typename remove_reference::type* v = 0; return *v; } + { nfp_detail::report_access_to_invalid_parameter(true); static typename remove_reference::type* v = 0; BOOST_UNREACHABLE_RETURN(*v); } template nil operator()( Arg1 const& ) - { nfp_detail::report_access_to_invalid_parameter(true); return nil(); } + { nfp_detail::report_access_to_invalid_parameter(true); BOOST_UNREACHABLE_RETURN(nil()); } template nil operator()( Arg1 const&, Arg2 const& ) - { nfp_detail::report_access_to_invalid_parameter(true); return nil(); } + { nfp_detail::report_access_to_invalid_parameter(true); BOOST_UNREACHABLE_RETURN(nil()); } template nil operator()( Arg1 const&, Arg2 const&, Arg3 const& ) - { nfp_detail::report_access_to_invalid_parameter(true); return nil(); } + { nfp_detail::report_access_to_invalid_parameter(true); BOOST_UNREACHABLE_RETURN(nil()); } // Visitation support template