From 49e2a46c3a9f6b30396adfd629321d748ef086a2 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 27 Jan 2025 17:41:50 +0200 Subject: [PATCH] Enable warnings=extra, warnings-as-errors=on in test suite --- include/boost/array.hpp | 6 +++--- test/Jamfile.v2 | 10 ++++++++++ test/array5.cpp | 2 ++ test/array6.cpp | 2 ++ test/array7.cpp | 2 ++ test/array_assign_test.cpp | 5 +++-- test/array_c_array_test.cpp | 5 +++-- test/array_size_test.cpp | 4 ++++ 8 files changed, 29 insertions(+), 7 deletions(-) diff --git a/include/boost/array.hpp b/include/boost/array.hpp index d1a7a2b..4e62c55 100644 --- a/include/boost/array.hpp +++ b/include/boost/array.hpp @@ -326,7 +326,7 @@ namespace boost { #if BOOST_WORKAROUND(BOOST_GCC, < 90000) template - BOOST_CXX14_CONSTEXPR bool operator== (const array& x, const array& y) + BOOST_CXX14_CONSTEXPR bool operator== (const array& /*x*/, const array& /*y*/) { return true; } @@ -353,7 +353,7 @@ namespace boost { #if BOOST_WORKAROUND(BOOST_GCC, < 90000) template - BOOST_CXX14_CONSTEXPR bool operator< (const array& x, const array& y) + BOOST_CXX14_CONSTEXPR bool operator< (const array& /*x*/, const array& /*y*/) { return false; } @@ -397,7 +397,7 @@ namespace boost { } template - constexpr auto operator<=> (const array& x, const array& y) + constexpr auto operator<=> (const array& /*x*/, const array& /*y*/) -> decltype( 0 <=> 0 ) { return 0 <=> 0; // std::strong_ordering::equal diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index eec7d63..282764a 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -7,6 +7,16 @@ import testing ; import-search /boost/config/checks ; import config : requires ; +project + : requirements + + extra + + msvc:on + clang:on + gcc:on + ; + # run array0.cpp ; diff --git a/test/array5.cpp b/test/array5.cpp index 23156b9..23352a7 100644 --- a/test/array5.cpp +++ b/test/array5.cpp @@ -5,6 +5,8 @@ * http://www.boost.org/LICENSE_1_0.txt) */ +#define BOOST_ALLOW_DEPRECATED_SYMBOLS // assign + #include #include diff --git a/test/array6.cpp b/test/array6.cpp index d2cca91..3f3f5b0 100644 --- a/test/array6.cpp +++ b/test/array6.cpp @@ -5,6 +5,8 @@ * http://www.boost.org/LICENSE_1_0.txt) */ +#define BOOST_ALLOW_DEPRECATED_SYMBOLS // get_c_array + #include #include #include diff --git a/test/array7.cpp b/test/array7.cpp index 567b2e6..1e70108 100644 --- a/test/array7.cpp +++ b/test/array7.cpp @@ -5,6 +5,8 @@ * http://www.boost.org/LICENSE_1_0.txt) */ +#define BOOST_ALLOW_DEPRECATED_SYMBOLS // std::get + #include #include #include diff --git a/test/array_assign_test.cpp b/test/array_assign_test.cpp index 91c9b16..b9255ca 100644 --- a/test/array_assign_test.cpp +++ b/test/array_assign_test.cpp @@ -2,12 +2,13 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt) +#define BOOST_ALLOW_DEPRECATED_SYMBOLS + #include #include #include -// assign is a nonstandard equivalent of fill -// it probably needs to be deprecated and removed +// assign is a deprecated nonstandard equivalent of fill template void test() { diff --git a/test/array_c_array_test.cpp b/test/array_c_array_test.cpp index b65d444..b89e25f 100644 --- a/test/array_c_array_test.cpp +++ b/test/array_c_array_test.cpp @@ -2,14 +2,15 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt) +#define BOOST_ALLOW_DEPRECATED_SYMBOLS + #include #include #include #include #include -// c_array and get_c_array are nonstandard extensions -// probably need to be deprecated and removed +// c_array and get_c_array are deprecated nonstandard extensions template void test() { diff --git a/test/array_size_test.cpp b/test/array_size_test.cpp index e8ac461..50aa55e 100644 --- a/test/array_size_test.cpp +++ b/test/array_size_test.cpp @@ -15,6 +15,8 @@ template void test1() BOOST_TEST_EQ( a.size(), N ); BOOST_TEST_EQ( a.empty(), N == 0 ); BOOST_TEST_EQ( a.max_size(), N ); + + (void)a; // msvc-12.0 } { @@ -23,6 +25,8 @@ template void test1() BOOST_TEST_EQ( a.size(), N ); BOOST_TEST_EQ( a.empty(), N == 0 ); BOOST_TEST_EQ( a.max_size(), N ); + + (void)a; // msvc-12.0 } }