[libcxx] r318277 - Tolerate even more [[nodiscard]] in the STL. Reviewed as https://reviews.llvm.org/D39080

Billy Robert O'Neal III via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 14 23:45:07 PST 2017


Author: bion
Date: Tue Nov 14 23:45:07 2017
New Revision: 318277

URL: http://llvm.org/viewvc/llvm-project?rev=318277&view=rev
Log:
Tolerate even more [[nodiscard]] in the STL. Reviewed as https://reviews.llvm.org/D39080

Modified:
    libcxx/trunk/test/std/algorithms/alg.nonmodifying/alg.search/search_n.pass.cpp
    libcxx/trunk/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp
    libcxx/trunk/test/std/containers/associative/map/map.access/at.pass.cpp
    libcxx/trunk/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp
    libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.disc/assign.pass.cpp
    libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.disc/copy.pass.cpp
    libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.disc/discard.pass.cpp
    libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/assign.pass.cpp
    libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/copy.pass.cpp
    libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/discard.pass.cpp
    libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/assign.pass.cpp
    libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/copy.pass.cpp
    libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_copy.pass.cpp
    libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_move.pass.cpp
    libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/discard.pass.cpp
    libcxx/trunk/test/std/numerics/rand/rand.device/eval.pass.cpp
    libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.lcong/discard.pass.cpp
    libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.mers/assign.pass.cpp
    libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.mers/copy.pass.cpp
    libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.mers/discard.pass.cpp
    libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.sub/assign.pass.cpp
    libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.sub/copy.pass.cpp
    libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.sub/discard.pass.cpp
    libcxx/trunk/test/std/re/re.alg/re.alg.search/grep.pass.cpp
    libcxx/trunk/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp
    libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp
    libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp
    libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp
    libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp
    libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp
    libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp
    libcxx/trunk/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
    libcxx/trunk/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp
    libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp
    libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp

Modified: libcxx/trunk/test/std/algorithms/alg.nonmodifying/alg.search/search_n.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/algorithms/alg.nonmodifying/alg.search/search_n.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/algorithms/alg.nonmodifying/alg.search/search_n.pass.cpp (original)
+++ libcxx/trunk/test/std/algorithms/alg.nonmodifying/alg.search/search_n.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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()

Modified: libcxx/trunk/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp (original)
+++ libcxx/trunk/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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;
 }
 

Modified: libcxx/trunk/test/std/containers/associative/map/map.access/at.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.access/at.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/associative/map/map.access/at.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/associative/map/map.access/at.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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&)

Modified: libcxx/trunk/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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&)

Modified: libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.disc/assign.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.disc/assign.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.disc/assign.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.disc/assign.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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);

Modified: libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.disc/copy.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.disc/copy.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.disc/copy.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.disc/copy.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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());

Modified: libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.disc/discard.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.disc/discard.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.disc/discard.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.disc/discard.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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);
 }
 

Modified: libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/assign.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/assign.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/assign.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/assign.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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);

Modified: libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/copy.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/copy.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/copy.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/copy.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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());

Modified: libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/discard.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/discard.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/discard.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/discard.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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);
 }
 

Modified: libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/assign.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/assign.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/assign.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/assign.pass.cpp Tue Nov 14 23:45:07 2017
@@ -22,7 +22,7 @@ test1()
 {
     typedef std::knuth_b E;
     E e1(2);
-    e1();
+    (void)e1();
     E e2(5);
     e2 = e1;
     assert(e1 == e2);

Modified: libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/copy.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/copy.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/copy.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/copy.pass.cpp Tue Nov 14 23:45:07 2017
@@ -22,7 +22,7 @@ test1()
 {
     typedef std::knuth_b E;
     E e1;
-    e1();
+    (void)e1();
     E e2 = e1;
     assert(e1 == e2);
     assert(e1() == e2());

Modified: libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_copy.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_copy.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_copy.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_copy.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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);
     }
 }

Modified: libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_move.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_move.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_move.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_move.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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);
     }
 }

Modified: libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/discard.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/discard.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/discard.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/discard.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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);
 }
 

Modified: libcxx/trunk/test/std/numerics/rand/rand.device/eval.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/rand/rand.device/eval.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/rand/rand.device/eval.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/rand/rand.device/eval.pass.cpp Tue Nov 14 23:45:07 2017
@@ -38,7 +38,7 @@ int main()
     try
     {
         std::random_device r("/dev/null");
-        r();
+        (void)r();
         LIBCPP_ASSERT(false);
     }
     catch (const std::system_error&)

Modified: libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.lcong/discard.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.lcong/discard.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.lcong/discard.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.lcong/discard.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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);
 }
 

Modified: libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.mers/assign.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.mers/assign.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.mers/assign.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.mers/assign.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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);

Modified: libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.mers/copy.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.mers/copy.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.mers/copy.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.mers/copy.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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());

Modified: libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.mers/discard.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.mers/discard.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.mers/discard.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.mers/discard.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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);
 }
 

Modified: libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.sub/assign.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.sub/assign.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.sub/assign.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.sub/assign.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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);

Modified: libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.sub/copy.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.sub/copy.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.sub/copy.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.sub/copy.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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());

Modified: libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.sub/discard.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.sub/discard.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.sub/discard.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/rand/rand.eng/rand.eng.sub/discard.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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);
 }
 

Modified: libcxx/trunk/test/std/re/re.alg/re.alg.search/grep.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/re/re.alg/re.alg.search/grep.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/re/re.alg/re.alg.search/grep.pass.cpp (original)
+++ libcxx/trunk/test/std/re/re.alg/re.alg.search/grep.pass.cpp Tue Nov 14 23:45:07 2017
@@ -33,7 +33,7 @@ extern "C" void LLVMFuzzerTestOneInput(c
             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 &) {}
     }

Modified: libcxx/trunk/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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)

Modified: libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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)

Modified: libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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)

Modified: libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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)

Modified: libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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)

Modified: libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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)

Modified: libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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)

Modified: libcxx/trunk/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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

Modified: libcxx/trunk/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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 &) {
     }

Modified: libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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); }

Modified: libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp?rev=318277&r1=318276&r2=318277&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp Tue Nov 14 23:45:07 2017
@@ -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));




More information about the cfe-commits mailing list