mirror of
https://github.com/boostorg/core.git
synced 2025-05-11 13:13:55 +00:00
Add test/bit_width_fail (refs #129)
This commit is contained in:
parent
3510f6244b
commit
2cc3e23447
@ -299,6 +299,9 @@ run bit_popcount_test.cpp
|
|||||||
run bit_endian_test.cpp
|
run bit_endian_test.cpp
|
||||||
: : : $(pedantic-errors) ;
|
: : : $(pedantic-errors) ;
|
||||||
|
|
||||||
|
compile-fail bit_width_fail.cpp
|
||||||
|
: <warnings>off ;
|
||||||
|
|
||||||
run type_name_test.cpp ;
|
run type_name_test.cpp ;
|
||||||
|
|
||||||
run sv_types_test.cpp ;
|
run sv_types_test.cpp ;
|
||||||
|
13
test/bit_width_fail.cpp
Normal file
13
test/bit_width_fail.cpp
Normal 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 );
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user