From: Billy Robert O'Neal III Date: Wed, 15 Nov 2017 07:45:07 +0000 (+0000) Subject: Tolerate even more [[nodiscard]] in the STL. Reviewed as https://reviews.llvm.org... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c240a89ffa0d7ca0afab6e36c8f8a58ec73e52f;p=platform%2Fupstream%2Fllvm.git Tolerate even more [[nodiscard]] in the STL. Reviewed as https://reviews.llvm.org/D39080 llvm-svn: 318277 --- diff --git a/libcxx/test/std/algorithms/alg.nonmodifying/alg.search/search_n.pass.cpp b/libcxx/test/std/algorithms/alg.nonmodifying/alg.search/search_n.pass.cpp index f7f8ee0..4874bca 100644 --- a/libcxx/test/std/algorithms/alg.nonmodifying/alg.search/search_n.pass.cpp +++ b/libcxx/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(0), 0); + (void)std::search_n(Iter(ic), Iter(ic+sc), UserDefinedIntegral(0), 0); } int main() diff --git a/libcxx/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp b/libcxx/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp index 8bc6f4d..6e8913e 100644 --- a/libcxx/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp +++ b/libcxx/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(4), 0, count_equal()); + (void)std::search_n(Iter(ic), Iter(ic+sc), UserDefinedIntegral(4), 0, count_equal()); count_equal::count = 0; } diff --git a/libcxx/test/std/containers/associative/map/map.access/at.pass.cpp b/libcxx/test/std/containers/associative/map/map.access/at.pass.cpp index 6d3e98e..89ba194 100644 --- a/libcxx/test/std/containers/associative/map/map.access/at.pass.cpp +++ b/libcxx/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/libcxx/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp index 8fbded4..27c95f1 100644 --- a/libcxx/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp +++ b/libcxx/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/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.disc/assign.pass.cpp b/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.disc/assign.pass.cpp index 18c8947..5238915 100644 --- a/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.disc/assign.pass.cpp +++ b/libcxx/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/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.disc/copy.pass.cpp b/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.disc/copy.pass.cpp index d6c64fa..80417e5 100644 --- a/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.disc/copy.pass.cpp +++ b/libcxx/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/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.disc/discard.pass.cpp b/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.disc/discard.pass.cpp index 2dada0d..d10b7c5 100644 --- a/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.disc/discard.pass.cpp +++ b/libcxx/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/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/assign.pass.cpp b/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/assign.pass.cpp index e4cd4f7..4484b3d 100644 --- a/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/assign.pass.cpp +++ b/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/assign.pass.cpp @@ -22,7 +22,7 @@ test1() { typedef std::independent_bits_engine 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 E; E e1(3); - e1(); + (void)e1(); E e2(5); e2 = e1; assert(e1 == e2); diff --git a/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/copy.pass.cpp b/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/copy.pass.cpp index e3e497e..6a01af4 100644 --- a/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/copy.pass.cpp +++ b/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/copy.pass.cpp @@ -22,7 +22,7 @@ test1() { typedef std::independent_bits_engine 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 E; E e1; - e1(); + (void)e1(); E e2 = e1; assert(e1 == e2); assert(e1() == e2()); diff --git a/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/discard.pass.cpp b/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/discard.pass.cpp index 2a356a1..a1b4dd7 100644 --- a/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/discard.pass.cpp +++ b/libcxx/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/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/assign.pass.cpp b/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/assign.pass.cpp index dae8c7c..652e648 100644 --- a/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/assign.pass.cpp +++ b/libcxx/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/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/copy.pass.cpp b/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/copy.pass.cpp index c9e9893..de26e2d 100644 --- a/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/copy.pass.cpp +++ b/libcxx/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/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_copy.pass.cpp b/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_copy.pass.cpp index a20c494..e71aa1d 100644 --- a/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_copy.pass.cpp +++ b/libcxx/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/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_move.pass.cpp b/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_move.pass.cpp index 9811787..4a347b5 100644 --- a/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_move.pass.cpp +++ b/libcxx/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/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/discard.pass.cpp b/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/discard.pass.cpp index 6e04e26..b442a76 100644 --- a/libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/discard.pass.cpp +++ b/libcxx/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/libcxx/test/std/numerics/rand/rand.device/eval.pass.cpp b/libcxx/test/std/numerics/rand/rand.device/eval.pass.cpp index b34e40c..5669031 100644 --- a/libcxx/test/std/numerics/rand/rand.device/eval.pass.cpp +++ b/libcxx/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/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/discard.pass.cpp b/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/discard.pass.cpp index 9e3372a..0a36fcb 100644 --- a/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/discard.pass.cpp +++ b/libcxx/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/libcxx/test/std/numerics/rand/rand.eng/rand.eng.mers/assign.pass.cpp b/libcxx/test/std/numerics/rand/rand.eng/rand.eng.mers/assign.pass.cpp index fda5b88..63d7168 100644 --- a/libcxx/test/std/numerics/rand/rand.eng/rand.eng.mers/assign.pass.cpp +++ b/libcxx/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/libcxx/test/std/numerics/rand/rand.eng/rand.eng.mers/copy.pass.cpp b/libcxx/test/std/numerics/rand/rand.eng/rand.eng.mers/copy.pass.cpp index 57c015c..a006b33 100644 --- a/libcxx/test/std/numerics/rand/rand.eng/rand.eng.mers/copy.pass.cpp +++ b/libcxx/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/libcxx/test/std/numerics/rand/rand.eng/rand.eng.mers/discard.pass.cpp b/libcxx/test/std/numerics/rand/rand.eng/rand.eng.mers/discard.pass.cpp index d20d661..480260d 100644 --- a/libcxx/test/std/numerics/rand/rand.eng/rand.eng.mers/discard.pass.cpp +++ b/libcxx/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/libcxx/test/std/numerics/rand/rand.eng/rand.eng.sub/assign.pass.cpp b/libcxx/test/std/numerics/rand/rand.eng/rand.eng.sub/assign.pass.cpp index 305d43a..60fec44 100644 --- a/libcxx/test/std/numerics/rand/rand.eng/rand.eng.sub/assign.pass.cpp +++ b/libcxx/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/libcxx/test/std/numerics/rand/rand.eng/rand.eng.sub/copy.pass.cpp b/libcxx/test/std/numerics/rand/rand.eng/rand.eng.sub/copy.pass.cpp index 27f8816..5944716 100644 --- a/libcxx/test/std/numerics/rand/rand.eng/rand.eng.sub/copy.pass.cpp +++ b/libcxx/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/libcxx/test/std/numerics/rand/rand.eng/rand.eng.sub/discard.pass.cpp b/libcxx/test/std/numerics/rand/rand.eng/rand.eng.sub/discard.pass.cpp index 4ba9381..ad33fc1 100644 --- a/libcxx/test/std/numerics/rand/rand.eng/rand.eng.sub/discard.pass.cpp +++ b/libcxx/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/libcxx/test/std/re/re.alg/re.alg.search/grep.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/grep.pass.cpp index fa4e675..13a352c 100644 --- a/libcxx/test/std/re/re.alg/re.alg.search/grep.pass.cpp +++ b/libcxx/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/libcxx/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp index 4ad7a3a..0f5f559 100644 --- a/libcxx/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp +++ b/libcxx/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/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp index 947b1ad..8eeb8af 100644 --- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp +++ b/libcxx/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/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp index 5cb8054..a4a0bb2 100644 --- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp +++ b/libcxx/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/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp index 3ba4128..6fb9aaa 100644 --- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp +++ b/libcxx/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/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp index 709c569..c7b255c 100644 --- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp +++ b/libcxx/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/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp index 6c98178..6a1dd0b 100644 --- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp +++ b/libcxx/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/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp index 57231b2..e0ffa10 100644 --- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp +++ b/libcxx/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/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp index ed04a91..5e0a116 100644 --- a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp +++ b/libcxx/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(a); + (void)any_cast(a); assert(false); } catch (bad_any_cast const &) { // do nothing @@ -89,7 +89,7 @@ void checkThrows(any& a) } try { - any_cast(static_cast(a)); + (void)any_cast(static_cast(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; - any_cast(static_cast(a)); + (void)any_cast(static_cast(a)); assert(false); } catch (bad_any_cast const &) { // do nothing diff --git a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp index 768d418..e77e7d8 100644 --- a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp +++ b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp @@ -23,7 +23,7 @@ void test_max(size_t count) { std::allocator a; try { - a.allocate(count); + (void)a.allocate(count); assert(false); } catch (const std::exception &) { } diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp index 30a4933..d678bde 100644 --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp +++ b/libcxx/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/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp index 73cf073..b7ea8d4 100644 --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp +++ b/libcxx/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 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));