Enable warnings=extra, warnings-as-errors=on in test suite

This commit is contained in:
Peter Dimov
2025-01-27 17:41:50 +02:00
parent 07a14f33ef
commit 49e2a46c3a
8 changed files with 29 additions and 7 deletions

View File

@ -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;
}
@ -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;
}
@ -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

View File

@ -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 ;

View File

@ -5,6 +5,8 @@
* http://www.boost.org/LICENSE_1_0.txt)
*/
#define BOOST_ALLOW_DEPRECATED_SYMBOLS // assign
#include <iostream>
#include <boost/array.hpp>

View File

@ -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>

View File

@ -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>

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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
}
{
@ -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
}
}