diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index a601332..29003c1 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -299,6 +299,9 @@ run bit_popcount_test.cpp run bit_endian_test.cpp : : : $(pedantic-errors) ; +compile-fail bit_width_fail.cpp + : off ; + run type_name_test.cpp ; run sv_types_test.cpp ; diff --git a/test/bit_width_fail.cpp b/test/bit_width_fail.cpp new file mode 100644 index 0000000..9e76000 --- /dev/null +++ b/test/bit_width_fail.cpp @@ -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 + +int main() +{ + // should fail, because 0 is a signed integral type + return boost::core::bit_width( 0 ); +}