Skip to content

Commit

Permalink
Enable warnings=extra, warnings-as-errors=on in test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Jan 27, 2025
1 parent 07a14f3 commit 49e2a46
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 7 deletions.
6 changes: 3 additions & 3 deletions include/boost/array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ namespace boost {
#if BOOST_WORKAROUND(BOOST_GCC, < 90000)

template<class T>
BOOST_CXX14_CONSTEXPR bool operator== (const array<T, 0>& x, const array<T, 0>& y)
BOOST_CXX14_CONSTEXPR bool operator== (const array<T, 0>& /*x*/, const array<T, 0>& /*y*/)
{
return true;
}
Expand All @@ -353,7 +353,7 @@ namespace boost {
#if BOOST_WORKAROUND(BOOST_GCC, < 90000)

template<class T>
BOOST_CXX14_CONSTEXPR bool operator< (const array<T, 0>& x, const array<T, 0>& y)
BOOST_CXX14_CONSTEXPR bool operator< (const array<T, 0>& /*x*/, const array<T, 0>& /*y*/)
{
return false;
}
Expand Down Expand Up @@ -397,7 +397,7 @@ namespace boost {
}

template<class T>
constexpr auto operator<=> (const array<T,0>& x, const array<T,0>& y)
constexpr auto operator<=> (const array<T,0>& /*x*/, const array<T,0>& /*y*/)
-> decltype( 0 <=> 0 )
{
return 0 <=> 0; // std::strong_ordering::equal
Expand Down
10 changes: 10 additions & 0 deletions test/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ import testing ;
import-search /boost/config/checks ;
import config : requires ;

project
: requirements

<warnings>extra

<toolset>msvc:<warnings-as-errors>on
<toolset>clang:<warnings-as-errors>on
<toolset>gcc:<warnings-as-errors>on
;

#

run array0.cpp ;
Expand Down
2 changes: 2 additions & 0 deletions test/array5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* http://www.boost.org/LICENSE_1_0.txt)
*/

#define BOOST_ALLOW_DEPRECATED_SYMBOLS // assign

#include <iostream>
#include <boost/array.hpp>

Expand Down
2 changes: 2 additions & 0 deletions test/array6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* http://www.boost.org/LICENSE_1_0.txt)
*/

#define BOOST_ALLOW_DEPRECATED_SYMBOLS // get_c_array

#include <string>
#include <iostream>
#include <boost/array.hpp>
Expand Down
2 changes: 2 additions & 0 deletions test/array7.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* http://www.boost.org/LICENSE_1_0.txt)
*/

#define BOOST_ALLOW_DEPRECATED_SYMBOLS // std::get

#include <string>
#include <iostream>
#include <boost/array.hpp>
Expand Down
5 changes: 3 additions & 2 deletions test/array_assign_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <boost/array.hpp>
#include <boost/core/lightweight_test.hpp>
#include <cstddef>

// assign is a nonstandard equivalent of fill
// it probably needs to be deprecated and removed
// assign is a deprecated nonstandard equivalent of fill

template<class T, std::size_t N> void test()
{
Expand Down
5 changes: 3 additions & 2 deletions test/array_c_array_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <boost/array.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
#include <cstddef>

// 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<class T, std::size_t N> void test()
{
Expand Down
4 changes: 4 additions & 0 deletions test/array_size_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ template<class T, std::size_t N> 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
}

{
Expand All @@ -23,6 +25,8 @@ template<class T, std::size_t N> 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
}
}

Expand Down

0 comments on commit 49e2a46

Please sign in to comment.