Suppress MSVC unreachable code warnings

This commit is contained in:
Peter Dimov
2025-01-27 18:23:43 +02:00
parent 49e2a46c3a
commit 75db85d1e9
8 changed files with 33 additions and 4 deletions

View File

@ -37,9 +37,10 @@
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
# pragma warning(push)
# pragma warning(disable:4510) // boost::array<T,N>' : default constructor could not be generated
# pragma warning(disable:4512) // boost::array<T,N>' : assignment operator could not be generated
# pragma warning(disable:4610) // class 'boost::array<T,N>' can never be instantiated - user defined constructor required
# pragma warning(disable: 4510) // boost::array<T,N>' : default constructor could not be generated
# pragma warning(disable: 4512) // boost::array<T,N>' : assignment operator could not be generated
# pragma warning(disable: 4610) // class 'boost::array<T,N>' can never be instantiated - user defined constructor required
# pragma warning(disable: 4702) // unreachable code
#endif
#include <boost/assert.hpp>

View File

@ -4,11 +4,15 @@
#define BOOST_ALLOW_DEPRECATED_SYMBOLS
// assign is a deprecated nonstandard equivalent of fill
#include <boost/array.hpp>
#include <boost/core/lightweight_test.hpp>
#include <cstddef>
// assign is a deprecated nonstandard equivalent of fill
#if defined(_MSC_VER)
# pragma warning(disable: 4702) // unreachable code
#endif
template<class T, std::size_t N> void test()
{

View File

@ -6,6 +6,10 @@
#include <boost/core/lightweight_test.hpp>
#include <cstddef>
#if defined(_MSC_VER)
# pragma warning(disable: 4702) // unreachable code
#endif
template<class T, std::size_t N> void test()
{
{

View File

@ -6,6 +6,10 @@
#include <boost/core/lightweight_test.hpp>
#include <cstddef>
#if defined(_MSC_VER)
# pragma warning(disable: 4702) // unreachable code
#endif
template<class T, std::size_t N> void test()
{
boost::array<T, N> a = {};

View File

@ -8,6 +8,10 @@
#include <boost/config/workaround.hpp>
#include <cstddef>
#if defined(_MSC_VER)
# pragma warning(disable: 4702) // unreachable code
#endif
template<class T, std::size_t N> void test1()
{
boost::array<T, N> a = {{}};

View File

@ -6,6 +6,10 @@
#include <boost/core/lightweight_test.hpp>
#include <cstddef>
#if defined(_MSC_VER)
# pragma warning(disable: 4702) // unreachable code
#endif
template<class T, std::size_t N> void test()
{
{

View File

@ -6,6 +6,10 @@
#include <boost/core/lightweight_test.hpp>
#include <cstddef>
#if defined(_MSC_VER)
# pragma warning(disable: 4702) // unreachable code
#endif
template<class T, std::size_t N> void test()
{
boost::array<T, N> a1 = {};

View File

@ -6,6 +6,10 @@
#include <boost/core/lightweight_test.hpp>
#include <cstddef>
#if defined(_MSC_VER)
# pragma warning(disable: 4702) // unreachable code
#endif
template<class T, std::size_t N> void test()
{
boost::array<T, N> a1 = {};