summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBilly Robert O'Neal III <bion@microsoft.com>2017-11-15 07:45:07 +0000
committerBilly Robert O'Neal III <bion@microsoft.com>2017-11-15 07:45:07 +0000
commitb9816677762c5dc7957a0c92a506505b12231580 (patch)
treecb6c6c3b1db5191fe74c3b2a335dceaedf02a964 /test
parent9ae62c79cc771ff6cefcd2a98f69ecf7b40ebd71 (diff)
Tolerate even more [[nodiscard]] in the STL. Reviewed as https://reviews.llvm.org/D39080
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318277 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.search/search_n.pass.cpp2
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp2
-rw-r--r--test/std/containers/associative/map/map.access/at.pass.cpp8
-rw-r--r--test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp4
-rw-r--r--test/std/numerics/rand/rand.adapt/rand.adapt.disc/assign.pass.cpp4
-rw-r--r--test/std/numerics/rand/rand.adapt/rand.adapt.disc/copy.pass.cpp4
-rw-r--r--test/std/numerics/rand/rand.adapt/rand.adapt.disc/discard.pass.cpp12
-rw-r--r--test/std/numerics/rand/rand.adapt/rand.adapt.ibits/assign.pass.cpp4
-rw-r--r--test/std/numerics/rand/rand.adapt/rand.adapt.ibits/copy.pass.cpp4
-rw-r--r--test/std/numerics/rand/rand.adapt/rand.adapt.ibits/discard.pass.cpp12
-rw-r--r--test/std/numerics/rand/rand.adapt/rand.adapt.shuf/assign.pass.cpp2
-rw-r--r--test/std/numerics/rand/rand.adapt/rand.adapt.shuf/copy.pass.cpp2
-rw-r--r--test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_copy.pass.cpp6
-rw-r--r--test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_move.pass.cpp6
-rw-r--r--test/std/numerics/rand/rand.adapt/rand.adapt.shuf/discard.pass.cpp6
-rw-r--r--test/std/numerics/rand/rand.device/eval.pass.cpp2
-rw-r--r--test/std/numerics/rand/rand.eng/rand.eng.lcong/discard.pass.cpp8
-rw-r--r--test/std/numerics/rand/rand.eng/rand.eng.mers/assign.pass.cpp4
-rw-r--r--test/std/numerics/rand/rand.eng/rand.eng.mers/copy.pass.cpp4
-rw-r--r--test/std/numerics/rand/rand.eng/rand.eng.mers/discard.pass.cpp12
-rw-r--r--test/std/numerics/rand/rand.eng/rand.eng.sub/assign.pass.cpp4
-rw-r--r--test/std/numerics/rand/rand.eng/rand.eng.sub/copy.pass.cpp4
-rw-r--r--test/std/numerics/rand/rand.eng/rand.eng.sub/discard.pass.cpp12
-rw-r--r--test/std/re/re.alg/re.alg.search/grep.pass.cpp2
-rw-r--r--test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp30
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp4
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp4
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp4
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp4
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp4
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp4
-rw-r--r--test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp6
-rw-r--r--test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp2
-rw-r--r--test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp2
-rw-r--r--test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp10
35 files changed, 104 insertions, 100 deletions
diff --git a/test/std/algorithms/alg.nonmodifying/alg.search/search_n.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.search/search_n.pass.cpp
index f7f8ee092..4874bcad8 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.search/search_n.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.search/search_n.pass.cpp
@@ -66,7 +66,7 @@ test()
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()
diff --git a/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp
index 8bc6f4d26..6e8913ea4 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp
@@ -142,7 +142,7 @@ test()
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;
}
diff --git a/test/std/containers/associative/map/map.access/at.pass.cpp b/test/std/containers/associative/map/map.access/at.pass.cpp
index 6d3e98e9e..89ba1943d 100644
--- a/test/std/containers/associative/map/map.access/at.pass.cpp
+++ b/test/std/containers/associative/map/map.access/at.pass.cpp
@@ -46,7 +46,7 @@ int main()
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- m.at(6);
+ (void)m.at(6);
assert(false);
}
catch (std::out_of_range&)
@@ -79,7 +79,7 @@ int main()
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- m.at(6);
+ (void)m.at(6);
assert(false);
}
catch (std::out_of_range&)
@@ -115,7 +115,7 @@ int main()
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- m.at(6);
+ (void)m.at(6);
assert(false);
}
catch (std::out_of_range&)
@@ -148,7 +148,7 @@ int main()
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- m.at(6);
+ (void)m.at(6);
assert(false);
}
catch (std::out_of_range&)
diff --git a/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp b/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp
index 8fbded4cd..27c95f180 100644
--- a/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp
@@ -72,7 +72,7 @@ int main()
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- c.at(11);
+ (void)c.at(11);
assert(false);
}
catch (std::out_of_range&)
@@ -130,7 +130,7 @@ int main()
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- c.at(11);
+ (void)c.at(11);
assert(false);
}
catch (std::out_of_range&)
diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.disc/assign.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.disc/assign.pass.cpp
index 18c8947af..5238915ee 100644
--- a/test/std/numerics/rand/rand.adapt/rand.adapt.disc/assign.pass.cpp
+++ b/test/std/numerics/rand/rand.adapt/rand.adapt.disc/assign.pass.cpp
@@ -22,7 +22,7 @@ test1()
{
typedef std::ranlux24 E;
E e1(2);
- e1();
+ (void)e1();
E e2(5);
e2 = e1;
assert(e1 == e2);
@@ -38,7 +38,7 @@ test2()
{
typedef std::ranlux48 E;
E e1(3);
- e1();
+ (void)e1();
E e2(5);
e2 = e1;
assert(e1 == e2);
diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.disc/copy.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.disc/copy.pass.cpp
index d6c64fa37..80417e5d6 100644
--- a/test/std/numerics/rand/rand.adapt/rand.adapt.disc/copy.pass.cpp
+++ b/test/std/numerics/rand/rand.adapt/rand.adapt.disc/copy.pass.cpp
@@ -22,7 +22,7 @@ test1()
{
typedef std::ranlux24 E;
E e1;
- e1();
+ (void)e1();
E e2 = e1;
assert(e1 == e2);
assert(e1() == e2());
@@ -37,7 +37,7 @@ test2()
{
typedef std::ranlux48 E;
E e1;
- e1();
+ (void)e1();
E e2 = e1;
assert(e1 == e2);
assert(e1() == e2());
diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.disc/discard.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.disc/discard.pass.cpp
index 2dada0d63..d10b7c5e8 100644
--- a/test/std/numerics/rand/rand.adapt/rand.adapt.disc/discard.pass.cpp
+++ b/test/std/numerics/rand/rand.adapt/rand.adapt.disc/discard.pass.cpp
@@ -25,9 +25,9 @@ test1()
assert(e1 == e2);
e1.discard(3);
assert(e1 != e2);
- e2();
- e2();
- e2();
+ (void)e2();
+ (void)e2();
+ (void)e2();
assert(e1 == e2);
}
@@ -39,9 +39,9 @@ test2()
assert(e1 == e2);
e1.discard(3);
assert(e1 != e2);
- e2();
- e2();
- e2();
+ (void)e2();
+ (void)e2();
+ (void)e2();
assert(e1 == e2);
}
diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/assign.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/assign.pass.cpp
index e4cd4f739..4484b3db4 100644
--- a/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/assign.pass.cpp
+++ b/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/assign.pass.cpp
@@ -22,7 +22,7 @@ test1()
{
typedef std::independent_bits_engine<std::ranlux24, 32, unsigned> E;
E e1(2);
- e1();
+ (void)e1();
E e2(5);
e2 = e1;
assert(e1 == e2);
@@ -38,7 +38,7 @@ test2()
{
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);
diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/copy.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/copy.pass.cpp
index e3e497ec8..6a01af4bf 100644
--- a/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/copy.pass.cpp
+++ b/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/copy.pass.cpp
@@ -22,7 +22,7 @@ test1()
{
typedef std::independent_bits_engine<std::ranlux24, 32, unsigned> E;
E e1;
- e1();
+ (void)e1();
E e2 = e1;
assert(e1 == e2);
assert(e1() == e2());
@@ -37,7 +37,7 @@ test2()
{
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());
diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/discard.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/discard.pass.cpp
index 2a356a1c8..a1b4dd7d7 100644
--- a/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/discard.pass.cpp
+++ b/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/discard.pass.cpp
@@ -25,9 +25,9 @@ test1()
assert(e1 == e2);
e1.discard(3);
assert(e1 != e2);
- e2();
- e2();
- e2();
+ (void)e2();
+ (void)e2();
+ (void)e2();
assert(e1 == e2);
}
@@ -39,9 +39,9 @@ test2()
assert(e1 == e2);
e1.discard(3);
assert(e1 != e2);
- e2();
- e2();
- e2();
+ (void)e2();
+ (void)e2();
+ (void)e2();
assert(e1 == e2);
}
diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/assign.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/assign.pass.cpp
index dae8c7c91..652e6487a 100644
--- a/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/assign.pass.cpp
+++ b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/assign.pass.cpp
@@ -22,7 +22,7 @@ test1()
{
typedef std::knuth_b E;
E e1(2);
- e1();
+ (void)e1();
E e2(5);
e2 = e1;
assert(e1 == e2);
diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/copy.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/copy.pass.cpp
index c9e9893de..de26e2dc7 100644
--- a/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/copy.pass.cpp
+++ b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/copy.pass.cpp
@@ -22,7 +22,7 @@ test1()
{
typedef std::knuth_b E;
E e1;
- e1();
+ (void)e1();
E e2 = e1;
assert(e1 == e2);
assert(e1() == e2());
diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_copy.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_copy.pass.cpp
index a20c494f3..e71aa1d89 100644
--- a/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_copy.pass.cpp
+++ b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_copy.pass.cpp
@@ -24,8 +24,10 @@ int main()
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);
}
}
diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_move.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_move.pass.cpp
index 981178782..4a347b5d5 100644
--- a/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_move.pass.cpp
+++ b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_move.pass.cpp
@@ -25,8 +25,10 @@ int main()
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);
}
}
diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/discard.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/discard.pass.cpp
index 6e04e26c7..b442a76ad 100644
--- a/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/discard.pass.cpp
+++ b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/discard.pass.cpp
@@ -25,9 +25,9 @@ test1()
assert(e1 == e2);
e1.discard(3);
assert(e1 != e2);
- e2();
- e2();
- e2();
+ (void)e2();
+ (void)e2();
+ (void)e2();
assert(e1 == e2);
}
diff --git a/test/std/numerics/rand/rand.device/eval.pass.cpp b/test/std/numerics/rand/rand.device/eval.pass.cpp
index b34e40c75..56690316c 100644
--- a/test/std/numerics/rand/rand.device/eval.pass.cpp
+++ b/test/std/numerics/rand/rand.device/eval.pass.cpp
@@ -38,7 +38,7 @@ int main()
try
{
std::random_device r("/dev/null");
- r();
+ (void)r();
LIBCPP_ASSERT(false);
}
catch (const std::system_error&)
diff --git a/test/std/numerics/rand/rand.eng/rand.eng.lcong/discard.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.lcong/discard.pass.cpp
index 9e3372a8c..0a36fcb71 100644
--- a/test/std/numerics/rand/rand.eng/rand.eng.lcong/discard.pass.cpp
+++ b/test/std/numerics/rand/rand.eng/rand.eng.lcong/discard.pass.cpp
@@ -47,13 +47,13 @@ other()
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);
}
diff --git a/test/std/numerics/rand/rand.eng/rand.eng.mers/assign.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.mers/assign.pass.cpp
index fda5b88de..63d7168f5 100644
--- a/test/std/numerics/rand/rand.eng/rand.eng.mers/assign.pass.cpp
+++ b/test/std/numerics/rand/rand.eng/rand.eng.mers/assign.pass.cpp
@@ -24,7 +24,7 @@ test1()
{
typedef std::mt19937 E;
E e1(2);
- e1();
+ (void)e1();
E e2(5);
e2 = e1;
assert(e1 == e2);
@@ -40,7 +40,7 @@ test2()
{
typedef std::mt19937_64 E;
E e1(3);
- e1();
+ (void)e1();
E e2(5);
e2 = e1;
assert(e1 == e2);
diff --git a/test/std/numerics/rand/rand.eng/rand.eng.mers/copy.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.mers/copy.pass.cpp
index 57c015ccc..a006b3324 100644
--- a/test/std/numerics/rand/rand.eng/rand.eng.mers/copy.pass.cpp
+++ b/test/std/numerics/rand/rand.eng/rand.eng.mers/copy.pass.cpp
@@ -24,7 +24,7 @@ test1()
{
typedef std::mt19937 E;
E e1;
- e1();
+ (void)e1();
E e2 = e1;
assert(e1 == e2);
assert(e1() == e2());
@@ -39,7 +39,7 @@ test2()
{
typedef std::mt19937_64 E;
E e1;
- e1();
+ (void)e1();
E e2(e1);
assert(e1 == e2);
assert(e1() == e2());
diff --git a/test/std/numerics/rand/rand.eng/rand.eng.mers/discard.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.mers/discard.pass.cpp
index d20d661d5..480260d8b 100644
--- a/test/std/numerics/rand/rand.eng/rand.eng.mers/discard.pass.cpp
+++ b/test/std/numerics/rand/rand.eng/rand.eng.mers/discard.pass.cpp
@@ -28,9 +28,9 @@ test1()
assert(e1 == e2);
e1.discard(3);
assert(e1 != e2);
- e2();
- e2();
- e2();
+ (void)e2();
+ (void)e2();
+ (void)e2();
assert(e1 == e2);
}
@@ -42,9 +42,9 @@ test2()
assert(e1 == e2);
e1.discard(3);
assert(e1 != e2);
- e2();
- e2();
- e2();
+ (void)e2();
+ (void)e2();
+ (void)e2();
assert(e1 == e2);
}
diff --git a/test/std/numerics/rand/rand.eng/rand.eng.sub/assign.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.sub/assign.pass.cpp
index 305d43ad4..60fec4462 100644
--- a/test/std/numerics/rand/rand.eng/rand.eng.sub/assign.pass.cpp
+++ b/test/std/numerics/rand/rand.eng/rand.eng.sub/assign.pass.cpp
@@ -22,7 +22,7 @@ test1()
{
typedef std::ranlux24_base E;
E e1(2);
- e1();
+ (void)e1();
E e2(5);
e2 = e1;
assert(e1 == e2);
@@ -38,7 +38,7 @@ test2()
{
typedef std::ranlux48_base E;
E e1(3);
- e1();
+ (void)e1();
E e2(5);
e2 = e1;
assert(e1 == e2);
diff --git a/test/std/numerics/rand/rand.eng/rand.eng.sub/copy.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.sub/copy.pass.cpp
index 27f88165b..5944716b6 100644
--- a/test/std/numerics/rand/rand.eng/rand.eng.sub/copy.pass.cpp
+++ b/test/std/numerics/rand/rand.eng/rand.eng.sub/copy.pass.cpp
@@ -22,7 +22,7 @@ test1()
{
typedef std::ranlux24_base E;
E e1;
- e1();
+ (void)e1();
E e2 = e1;
assert(e1 == e2);
assert(e1() == e2());
@@ -37,7 +37,7 @@ test2()
{
typedef std::ranlux48_base E;
E e1;
- e1();
+ (void)e1();
E e2(e1);
assert(e1 == e2);
assert(e1() == e2());
diff --git a/test/std/numerics/rand/rand.eng/rand.eng.sub/discard.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.sub/discard.pass.cpp
index 4ba93819e..ad33fc151 100644
--- a/test/std/numerics/rand/rand.eng/rand.eng.sub/discard.pass.cpp
+++ b/test/std/numerics/rand/rand.eng/rand.eng.sub/discard.pass.cpp
@@ -25,9 +25,9 @@ test1()
assert(e1 == e2);
e1.discard(3);
assert(e1 != e2);
- e2();
- e2();
- e2();
+ (void)e2();
+ (void)e2();
+ (void)e2();
assert(e1 == e2);
}
@@ -39,9 +39,9 @@ test2()
assert(e1 == e2);
e1.discard(3);
assert(e1 != e2);
- e2();
- e2();
- e2();
+ (void)e2();
+ (void)e2();
+ (void)e2();
assert(e1 == e2);
}
diff --git a/test/std/re/re.alg/re.alg.search/grep.pass.cpp b/test/std/re/re.alg/re.alg.search/grep.pass.cpp
index fa4e675c7..13a352c3e 100644
--- a/test/std/re/re.alg/re.alg.search/grep.pass.cpp
+++ b/test/std/re/re.alg/re.alg.search/grep.pass.cpp
@@ -33,7 +33,7 @@ extern "C" void LLVMFuzzerTestOneInput(const char *data)
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 &) {}
}
diff --git a/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp
index 4ad7a3ac2..0f5f5591f 100644
--- a/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp
@@ -102,7 +102,7 @@ int main()
L2 l1;
try
{
- std::try_lock(l0, l1);
+ (void)std::try_lock(l0, l1);
assert(false);
}
catch (int)
@@ -116,7 +116,7 @@ int main()
L0 l1;
try
{
- std::try_lock(l0, l1);
+ (void)std::try_lock(l0, l1);
assert(false);
}
catch (int)
@@ -152,7 +152,7 @@ int main()
L2 l2;
try
{
- std::try_lock(l0, l1, l2);
+ (void)std::try_lock(l0, l1, l2);
assert(false);
}
catch (int)
@@ -206,7 +206,7 @@ int main()
L2 l2;
try
{
- std::try_lock(l0, l1, l2);
+ (void)std::try_lock(l0, l1, l2);
assert(false);
}
catch (int)
@@ -222,7 +222,7 @@ int main()
L0 l2;
try
{
- std::try_lock(l0, l1, l2);
+ (void)std::try_lock(l0, l1, l2);
assert(false);
}
catch (int)
@@ -238,7 +238,7 @@ int main()
L0 l2;
try
{
- std::try_lock(l0, l1, l2);
+ (void)std::try_lock(l0, l1, l2);
assert(false);
}
catch (int)
@@ -301,7 +301,7 @@ int main()
L1 l2;
try
{
- std::try_lock(l0, l1, l2);
+ (void)std::try_lock(l0, l1, l2);
assert(false);
}
catch (int)
@@ -317,7 +317,7 @@ int main()
L0 l2;
try
{
- std::try_lock(l0, l1, l2);
+ (void)std::try_lock(l0, l1, l2);
assert(false);
}
catch (int)
@@ -333,7 +333,7 @@ int main()
L2 l2;
try
{
- std::try_lock(l0, l1, l2);
+ (void)std::try_lock(l0, l1, l2);
assert(false);
}
catch (int)
@@ -349,7 +349,7 @@ int main()
L2 l2;
try
{
- std::try_lock(l0, l1, l2);
+ (void)std::try_lock(l0, l1, l2);
assert(false);
}
catch (int)
@@ -365,7 +365,7 @@ int main()
L1 l2;
try
{
- std::try_lock(l0, l1, l2);
+ (void)std::try_lock(l0, l1, l2);
assert(false);
}
catch (int)
@@ -381,7 +381,7 @@ int main()
L2 l2;
try
{
- std::try_lock(l0, l1, l2);
+ (void)std::try_lock(l0, l1, l2);
assert(false);
}
catch (int)
@@ -406,7 +406,7 @@ int main()
L1 l2;
try
{
- std::try_lock(l0, l1, l2);
+ (void)std::try_lock(l0, l1, l2);
assert(false);
}
catch (int)
@@ -440,7 +440,7 @@ int main()
L1 l2;
try
{
- std::try_lock(l0, l1, l2);
+ (void)std::try_lock(l0, l1, l2);
assert(false);
}
catch (int)
@@ -456,7 +456,7 @@ int main()
L0 l2;
try
{
- std::try_lock(l0, l1, l2);
+ (void)std::try_lock(l0, l1, l2);
assert(false);
}
catch (int)
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp
index 947b1ad01..8eeb8af2e 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp
@@ -44,7 +44,7 @@ int main()
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- lk.try_lock();
+ (void)lk.try_lock();
assert(false);
}
catch (std::system_error& e)
@@ -60,7 +60,7 @@ int main()
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- lk.try_lock();
+ (void)lk.try_lock();
assert(false);
}
catch (std::system_error& e)
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp
index 5cb805412..a4a0bb2ff 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp
@@ -49,7 +49,7 @@ int main()
#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)
@@ -65,7 +65,7 @@ int main()
#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)
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp
index 3ba4128d7..6fb9aaafd 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp
@@ -49,7 +49,7 @@ int main()
#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)
@@ -65,7 +65,7 @@ int main()
#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)
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp
index 709c56978..c7b255ca1 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp
@@ -43,7 +43,7 @@ int main()
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- lk.try_lock();
+ (void)lk.try_lock();
assert(false);
}
catch (std::system_error& e)
@@ -59,7 +59,7 @@ int main()
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- lk.try_lock();
+ (void)lk.try_lock();
assert(false);
}
catch (std::system_error& e)
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp
index 6c981787d..6a1dd0bc0 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp
@@ -48,7 +48,7 @@ int main()
#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)
@@ -64,7 +64,7 @@ int main()
#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)
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp
index 57231b207..e0ffa102d 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp
@@ -48,7 +48,7 @@ int main()
#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)
@@ -64,7 +64,7 @@ int main()
#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)
diff --git a/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp b/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
index ed04a91ca..5e0a116a5 100644
--- a/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
+++ b/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
@@ -80,7 +80,7 @@ void checkThrows(any& a)
{
#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
@@ -89,7 +89,7 @@ void checkThrows(any& a)
}
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
@@ -103,7 +103,7 @@ void checkThrows(any& a)
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
diff --git a/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp b/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp
index 768d41878..e77e7d82a 100644
--- a/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp
+++ b/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp
@@ -23,7 +23,7 @@ void test_max(size_t count)
{
std::allocator<T> a;
try {
- a.allocate(count);
+ (void)a.allocate(count);
assert(false);
} catch (const std::exception &) {
}
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp
index 30a493381..d678bdede 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp
@@ -134,7 +134,7 @@ int main()
#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); }
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp
index 73cf07336..b7ea8d4dc 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp
@@ -112,11 +112,11 @@ int main()
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));