Fix unused variables in tests to placate scan-build. Patch from Steve MacKenzie.
authorEric Fiselier <eric@efcs.ca>
Sun, 19 Oct 2014 00:10:15 +0000 (00:10 +0000)
committerEric Fiselier <eric@efcs.ca>
Sun, 19 Oct 2014 00:10:15 +0000 (00:10 +0000)
llvm-svn: 220154

libcxx/test/atomics/atomics.types.generic/bool.pass.cpp
libcxx/test/containers/associative/multimap/multimap.modifiers/erase_key.pass.cpp
libcxx/test/containers/sequences/array/array.data/data.pass.cpp
libcxx/test/containers/sequences/array/array.data/data_const.pass.cpp
libcxx/test/depr/depr.c.headers/tgmath_h.pass.cpp

index 500a2a2..dd851e8 100644 (file)
@@ -68,6 +68,7 @@ int main()
         std::atomic_init(&obj, true);
         assert(obj == true);
         bool b0 = obj.is_lock_free();
+        (void)b0; // to placate scan-build
         obj.store(false);
         assert(obj == false);
         obj.store(true, std::memory_order_release);
@@ -123,6 +124,7 @@ int main()
         std::atomic_init(&obj, true);
         assert(obj == true);
         bool b0 = obj.is_lock_free();
+        (void)b0; // to placate scan-build
         obj.store(false);
         assert(obj == false);
         obj.store(true, std::memory_order_release);
@@ -178,6 +180,7 @@ int main()
         std::atomic_init(&obj, true);
         assert(obj == true);
         bool b0 = obj.is_lock_free();
+        (void)b0; // to placate scan-build
         obj.store(false);
         assert(obj == false);
         obj.store(true, std::memory_order_release);
index ebae10e..33821d3 100644 (file)
@@ -71,6 +71,7 @@ int main()
         assert(next(m.begin(), 5)->second == 2);
 
         i = m.erase(3);
+        assert(i == 3);
         assert(m.size() == 3);
         assert(next(m.begin(), 0)->first == 1);
         assert(next(m.begin(), 0)->second == 1);
@@ -135,6 +136,7 @@ int main()
         assert(next(m.begin(), 5)->second == 2);
 
         i = m.erase(3);
+        assert(i == 3);
         assert(m.size() == 3);
         assert(next(m.begin(), 0)->first == 1);
         assert(next(m.begin(), 0)->second == 1);
index ea91357..08e4fd3 100644 (file)
@@ -30,5 +30,6 @@ int main()
         typedef std::array<T, 0> C;
         C c = {};
         T* p = c.data();
+        (void)p; // to placate scan-build
     }
 }
index 93acb71..8eb9762 100644 (file)
@@ -30,5 +30,6 @@ int main()
         typedef std::array<T, 0> C;
         const C c = {};
         const T* p = c.data();
+        (void)p; // to placate scan-build
     }
 }
index c4c9e85..a2ef814 100644 (file)
@@ -19,4 +19,5 @@ int main()
 {
     std::complex<double> cd;
     double x = sin(1.0);
+    (void)x; // to placate scan-build
 }