Add test/bit_width_fail (refs #129)

This commit is contained in:
Peter Dimov 2022-09-21 18:55:31 +03:00
parent 3510f6244b
commit 2cc3e23447
2 changed files with 16 additions and 0 deletions

View File

@ -299,6 +299,9 @@ run bit_popcount_test.cpp
run bit_endian_test.cpp
: : : $(pedantic-errors) ;
compile-fail bit_width_fail.cpp
: <warnings>off ;
run type_name_test.cpp ;
run sv_types_test.cpp ;

13
test/bit_width_fail.cpp Normal file
View File

@ -0,0 +1,13 @@
// Negative test for boost/core/bit.hpp (bit_width)
//
// Copyright 2022 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/core/bit.hpp>
int main()
{
// should fail, because 0 is a signed integral type
return boost::core::bit_width( 0 );
}