assert(std::search_n(Iter(ic), Iter(ic+sc), 4, 0) == Iter(ic+sc));
// Check that we properly convert the size argument to an integral.
- std::search_n(Iter(ic), Iter(ic+sc), UserDefinedIntegral<unsigned>(0), 0);
+ (void)std::search_n(Iter(ic), Iter(ic+sc), UserDefinedIntegral<unsigned>(0), 0);
}
int main()
count_equal::count = 0;
// Check that we properly convert the size argument to an integral.
- std::search_n(Iter(ic), Iter(ic+sc), UserDefinedIntegral<unsigned>(4), 0, count_equal());
+ (void)std::search_n(Iter(ic), Iter(ic+sc), UserDefinedIntegral<unsigned>(4), 0, count_equal());
count_equal::count = 0;
}
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- m.at(6);
+ (void)m.at(6);
assert(false);
}
catch (std::out_of_range&)
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- m.at(6);
+ (void)m.at(6);
assert(false);
}
catch (std::out_of_range&)
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- m.at(6);
+ (void)m.at(6);
assert(false);
}
catch (std::out_of_range&)
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- m.at(6);
+ (void)m.at(6);
assert(false);
}
catch (std::out_of_range&)
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- c.at(11);
+ (void)c.at(11);
assert(false);
}
catch (std::out_of_range&)
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- c.at(11);
+ (void)c.at(11);
assert(false);
}
catch (std::out_of_range&)
{
typedef std::ranlux24 E;
E e1(2);
- e1();
+ (void)e1();
E e2(5);
e2 = e1;
assert(e1 == e2);
{
typedef std::ranlux48 E;
E e1(3);
- e1();
+ (void)e1();
E e2(5);
e2 = e1;
assert(e1 == e2);
{
typedef std::ranlux24 E;
E e1;
- e1();
+ (void)e1();
E e2 = e1;
assert(e1 == e2);
assert(e1() == e2());
{
typedef std::ranlux48 E;
E e1;
- e1();
+ (void)e1();
E e2 = e1;
assert(e1 == e2);
assert(e1() == e2());
assert(e1 == e2);
e1.discard(3);
assert(e1 != e2);
- e2();
- e2();
- e2();
+ (void)e2();
+ (void)e2();
+ (void)e2();
assert(e1 == e2);
}
assert(e1 == e2);
e1.discard(3);
assert(e1 != e2);
- e2();
- e2();
- e2();
+ (void)e2();
+ (void)e2();
+ (void)e2();
assert(e1 == e2);
}
{
typedef std::independent_bits_engine<std::ranlux24, 32, unsigned> E;
E e1(2);
- e1();
+ (void)e1();
E e2(5);
e2 = e1;
assert(e1 == e2);
{
typedef std::independent_bits_engine<std::ranlux48, 64, unsigned long long> E;
E e1(3);
- e1();
+ (void)e1();
E e2(5);
e2 = e1;
assert(e1 == e2);
{
typedef std::independent_bits_engine<std::ranlux24, 32, unsigned> E;
E e1;
- e1();
+ (void)e1();
E e2 = e1;
assert(e1 == e2);
assert(e1() == e2());
{
typedef std::independent_bits_engine<std::ranlux48, 64, unsigned long long> E;
E e1;
- e1();
+ (void)e1();
E e2 = e1;
assert(e1 == e2);
assert(e1() == e2());
assert(e1 == e2);
e1.discard(3);
assert(e1 != e2);
- e2();
- e2();
- e2();
+ (void)e2();
+ (void)e2();
+ (void)e2();
assert(e1 == e2);
}
assert(e1 == e2);
e1.discard(3);
assert(e1 != e2);
- e2();
- e2();
- e2();
+ (void)e2();
+ (void)e2();
+ (void)e2();
assert(e1 == e2);
}
{
typedef std::knuth_b E;
E e1(2);
- e1();
+ (void)e1();
E e2(5);
e2 = e1;
assert(e1 == e2);
{
typedef std::knuth_b E;
E e1;
- e1();
+ (void)e1();
E e2 = e1;
assert(e1 == e2);
assert(e1() == e2());
typedef std::knuth_b Adaptor;
Engine e;
Adaptor a(e);
- for (unsigned k = 0; k <= Adaptor::table_size; ++k)
- e();
+ for (unsigned k = 0; k <= Adaptor::table_size; ++k) {
+ (void)e();
+ }
+
assert(a.base() == e);
}
}
Engine e;
Engine e0 = e;
Adaptor a(std::move(e0));
- for (unsigned k = 0; k <= Adaptor::table_size; ++k)
- e();
+ for (unsigned k = 0; k <= Adaptor::table_size; ++k) {
+ (void)e();
+ }
+
assert(a.base() == e);
}
}
assert(e1 == e2);
e1.discard(3);
assert(e1 != e2);
- e2();
- e2();
- e2();
+ (void)e2();
+ (void)e2();
+ (void)e2();
assert(e1 == e2);
}
try
{
std::random_device r("/dev/null");
- r();
+ (void)r();
LIBCPP_ASSERT(false);
}
catch (const std::system_error&)
assert(e1 == e2);
e1.discard(1);
assert(e1 != e2);
- e2();
+ (void)e2();
assert(e1 == e2);
e1.discard(3);
assert(e1 != e2);
- e2();
- e2();
- e2();
+ (void)e2();
+ (void)e2();
+ (void)e2();
assert(e1 == e2);
}
{
typedef std::mt19937 E;
E e1(2);
- e1();
+ (void)e1();
E e2(5);
e2 = e1;
assert(e1 == e2);
{
typedef std::mt19937_64 E;
E e1(3);
- e1();
+ (void)e1();
E e2(5);
e2 = e1;
assert(e1 == e2);
{
typedef std::mt19937 E;
E e1;
- e1();
+ (void)e1();
E e2 = e1;
assert(e1 == e2);
assert(e1() == e2());
{
typedef std::mt19937_64 E;
E e1;
- e1();
+ (void)e1();
E e2(e1);
assert(e1 == e2);
assert(e1() == e2());
assert(e1 == e2);
e1.discard(3);
assert(e1 != e2);
- e2();
- e2();
- e2();
+ (void)e2();
+ (void)e2();
+ (void)e2();
assert(e1 == e2);
}
assert(e1 == e2);
e1.discard(3);
assert(e1 != e2);
- e2();
- e2();
- e2();
+ (void)e2();
+ (void)e2();
+ (void)e2();
assert(e1 == e2);
}
{
typedef std::ranlux24_base E;
E e1(2);
- e1();
+ (void)e1();
E e2(5);
e2 = e1;
assert(e1 == e2);
{
typedef std::ranlux48_base E;
E e1(3);
- e1();
+ (void)e1();
E e2(5);
e2 = e1;
assert(e1 == e2);
{
typedef std::ranlux24_base E;
E e1;
- e1();
+ (void)e1();
E e2 = e1;
assert(e1 == e2);
assert(e1() == e2());
{
typedef std::ranlux48_base E;
E e1;
- e1();
+ (void)e1();
E e2(e1);
assert(e1 == e2);
assert(e1() == e2());
assert(e1 == e2);
e1.discard(3);
assert(e1 != e2);
- e2();
- e2();
- e2();
+ (void)e2();
+ (void)e2();
+ (void)e2();
assert(e1 == e2);
}
assert(e1 == e2);
e1.discard(3);
assert(e1 != e2);
- e2();
- e2();
- e2();
+ (void)e2();
+ (void)e2();
+ (void)e2();
assert(e1 == e2);
}
std::regex::flag_type flag = std::regex_constants::grep;
std::string s((const char *)data, size);
std::regex re(s, flag);
- std::regex_match(s, re);
+ (void)std::regex_match(s, re);
}
catch (std::regex_error &) {}
}
L2 l1;
try
{
- std::try_lock(l0, l1);
+ (void)std::try_lock(l0, l1);
assert(false);
}
catch (int)
L0 l1;
try
{
- std::try_lock(l0, l1);
+ (void)std::try_lock(l0, l1);
assert(false);
}
catch (int)
L2 l2;
try
{
- std::try_lock(l0, l1, l2);
+ (void)std::try_lock(l0, l1, l2);
assert(false);
}
catch (int)
L2 l2;
try
{
- std::try_lock(l0, l1, l2);
+ (void)std::try_lock(l0, l1, l2);
assert(false);
}
catch (int)
L0 l2;
try
{
- std::try_lock(l0, l1, l2);
+ (void)std::try_lock(l0, l1, l2);
assert(false);
}
catch (int)
L0 l2;
try
{
- std::try_lock(l0, l1, l2);
+ (void)std::try_lock(l0, l1, l2);
assert(false);
}
catch (int)
L1 l2;
try
{
- std::try_lock(l0, l1, l2);
+ (void)std::try_lock(l0, l1, l2);
assert(false);
}
catch (int)
L0 l2;
try
{
- std::try_lock(l0, l1, l2);
+ (void)std::try_lock(l0, l1, l2);
assert(false);
}
catch (int)
L2 l2;
try
{
- std::try_lock(l0, l1, l2);
+ (void)std::try_lock(l0, l1, l2);
assert(false);
}
catch (int)
L2 l2;
try
{
- std::try_lock(l0, l1, l2);
+ (void)std::try_lock(l0, l1, l2);
assert(false);
}
catch (int)
L1 l2;
try
{
- std::try_lock(l0, l1, l2);
+ (void)std::try_lock(l0, l1, l2);
assert(false);
}
catch (int)
L2 l2;
try
{
- std::try_lock(l0, l1, l2);
+ (void)std::try_lock(l0, l1, l2);
assert(false);
}
catch (int)
L1 l2;
try
{
- std::try_lock(l0, l1, l2);
+ (void)std::try_lock(l0, l1, l2);
assert(false);
}
catch (int)
L1 l2;
try
{
- std::try_lock(l0, l1, l2);
+ (void)std::try_lock(l0, l1, l2);
assert(false);
}
catch (int)
L0 l2;
try
{
- std::try_lock(l0, l1, l2);
+ (void)std::try_lock(l0, l1, l2);
assert(false);
}
catch (int)
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- lk.try_lock();
+ (void)lk.try_lock();
assert(false);
}
catch (std::system_error& e)
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- lk.try_lock();
+ (void)lk.try_lock();
assert(false);
}
catch (std::system_error& e)
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- lk.try_lock_for(ms(5));
+ (void)lk.try_lock_for(ms(5));
assert(false);
}
catch (std::system_error& e)
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- lk.try_lock_for(ms(5));
+ (void)lk.try_lock_for(ms(5));
assert(false);
}
catch (std::system_error& e)
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- lk.try_lock_until(Clock::now());
+ (void)lk.try_lock_until(Clock::now());
assert(false);
}
catch (std::system_error& e)
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- lk.try_lock_until(Clock::now());
+ (void)lk.try_lock_until(Clock::now());
assert(false);
}
catch (std::system_error& e)
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- lk.try_lock();
+ (void)lk.try_lock();
assert(false);
}
catch (std::system_error& e)
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- lk.try_lock();
+ (void)lk.try_lock();
assert(false);
}
catch (std::system_error& e)
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- lk.try_lock_for(ms(5));
+ (void)lk.try_lock_for(ms(5));
assert(false);
}
catch (std::system_error& e)
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- lk.try_lock_for(ms(5));
+ (void)lk.try_lock_for(ms(5));
assert(false);
}
catch (std::system_error& e)
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- lk.try_lock_until(Clock::now());
+ (void)lk.try_lock_until(Clock::now());
assert(false);
}
catch (std::system_error& e)
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- lk.try_lock_until(Clock::now());
+ (void)lk.try_lock_until(Clock::now());
assert(false);
}
catch (std::system_error& e)
{
#if !defined(TEST_HAS_NO_EXCEPTIONS)
try {
- any_cast<Type>(a);
+ (void)any_cast<Type>(a);
assert(false);
} catch (bad_any_cast const &) {
// do nothing
}
try {
- any_cast<ConstT>(static_cast<any const&>(a));
+ (void)any_cast<ConstT>(static_cast<any const&>(a));
assert(false);
} catch (bad_any_cast const &) {
// do nothing
typename std::remove_reference<Type>::type&&,
Type
>::type;
- any_cast<RefType>(static_cast<any&&>(a));
+ (void)any_cast<RefType>(static_cast<any&&>(a));
assert(false);
} catch (bad_any_cast const &) {
// do nothing
{
std::allocator<T> a;
try {
- a.allocate(count);
+ (void)a.allocate(count);
assert(false);
} catch (const std::exception &) {
}
#ifndef TEST_HAS_NO_EXCEPTIONS
try {
- ptr->shared_from_this();
+ (void)ptr->shared_from_this();
assert(false);
} catch (std::bad_weak_ptr const&) {
} catch (...) { assert(false); }
std::weak_ptr<int> wp1;
std::owner_less<> cmp;
- cmp(sp1, sp2);
- cmp(sp1, wp1);
- cmp(sp1, sp3);
- cmp(wp1, sp1);
- cmp(wp1, wp1);
+ assert(!cmp(sp1, sp2));
+ assert(!cmp(sp1, wp1));
+ assert(!cmp(sp1, sp3));
+ assert(!cmp(wp1, sp1));
+ assert(!cmp(wp1, wp1));
ASSERT_NOEXCEPT(cmp(sp1, sp1));
ASSERT_NOEXCEPT(cmp(sp1, wp1));
ASSERT_NOEXCEPT(cmp(wp1, sp1));