Skip to content

Commit 75db85d

Browse files
committed
Suppress MSVC unreachable code warnings
1 parent 49e2a46 commit 75db85d

8 files changed

Lines changed: 33 additions & 4 deletions

File tree

include/boost/array.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@
3737

3838
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
3939
# pragma warning(push)
40-
# pragma warning(disable:4510) // boost::array<T,N>' : default constructor could not be generated
41-
# pragma warning(disable:4512) // boost::array<T,N>' : assignment operator could not be generated
42-
# pragma warning(disable:4610) // class 'boost::array<T,N>' can never be instantiated - user defined constructor required
40+
# pragma warning(disable: 4510) // boost::array<T,N>' : default constructor could not be generated
41+
# pragma warning(disable: 4512) // boost::array<T,N>' : assignment operator could not be generated
42+
# pragma warning(disable: 4610) // class 'boost::array<T,N>' can never be instantiated - user defined constructor required
43+
# pragma warning(disable: 4702) // unreachable code
4344
#endif
4445

4546
#include <boost/assert.hpp>

test/array_assign_test.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@
44

55
#define BOOST_ALLOW_DEPRECATED_SYMBOLS
66

7+
// assign is a deprecated nonstandard equivalent of fill
8+
79
#include <boost/array.hpp>
810
#include <boost/core/lightweight_test.hpp>
911
#include <cstddef>
1012

11-
// assign is a deprecated nonstandard equivalent of fill
13+
#if defined(_MSC_VER)
14+
# pragma warning(disable: 4702) // unreachable code
15+
#endif
1216

1317
template<class T, std::size_t N> void test()
1418
{

test/array_eq_test.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
#include <boost/core/lightweight_test.hpp>
77
#include <cstddef>
88

9+
#if defined(_MSC_VER)
10+
# pragma warning(disable: 4702) // unreachable code
11+
#endif
12+
913
template<class T, std::size_t N> void test()
1014
{
1115
{

test/array_fill_test.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
#include <boost/core/lightweight_test.hpp>
77
#include <cstddef>
88

9+
#if defined(_MSC_VER)
10+
# pragma warning(disable: 4702) // unreachable code
11+
#endif
12+
913
template<class T, std::size_t N> void test()
1014
{
1115
boost::array<T, N> a = {};

test/array_init_test.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
#include <boost/config/workaround.hpp>
99
#include <cstddef>
1010

11+
#if defined(_MSC_VER)
12+
# pragma warning(disable: 4702) // unreachable code
13+
#endif
14+
1115
template<class T, std::size_t N> void test1()
1216
{
1317
boost::array<T, N> a = {{}};

test/array_lt_test.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
#include <boost/core/lightweight_test.hpp>
77
#include <cstddef>
88

9+
#if defined(_MSC_VER)
10+
# pragma warning(disable: 4702) // unreachable code
11+
#endif
12+
913
template<class T, std::size_t N> void test()
1014
{
1115
{

test/array_swap_test.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
#include <boost/core/lightweight_test.hpp>
77
#include <cstddef>
88

9+
#if defined(_MSC_VER)
10+
# pragma warning(disable: 4702) // unreachable code
11+
#endif
12+
913
template<class T, std::size_t N> void test()
1014
{
1115
boost::array<T, N> a1 = {};

test/array_swap_test2.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
#include <boost/core/lightweight_test.hpp>
77
#include <cstddef>
88

9+
#if defined(_MSC_VER)
10+
# pragma warning(disable: 4702) // unreachable code
11+
#endif
12+
913
template<class T, std::size_t N> void test()
1014
{
1115
boost::array<T, N> a1 = {};

0 commit comments

Comments
 (0)