Fix unused variables in tests to placate scan-build. Patch from Steve MacKenzie.

llvm-svn: 220154
This commit is contained in:
Eric Fiselier 2014-10-19 00:10:15 +00:00
parent afefe97e1c
commit ac97f7ce7c
5 changed files with 8 additions and 0 deletions

View File

@ -68,6 +68,7 @@ int main()
std::atomic_init(&obj, true); std::atomic_init(&obj, true);
assert(obj == true); assert(obj == true);
bool b0 = obj.is_lock_free(); bool b0 = obj.is_lock_free();
(void)b0; // to placate scan-build
obj.store(false); obj.store(false);
assert(obj == false); assert(obj == false);
obj.store(true, std::memory_order_release); obj.store(true, std::memory_order_release);
@ -123,6 +124,7 @@ int main()
std::atomic_init(&obj, true); std::atomic_init(&obj, true);
assert(obj == true); assert(obj == true);
bool b0 = obj.is_lock_free(); bool b0 = obj.is_lock_free();
(void)b0; // to placate scan-build
obj.store(false); obj.store(false);
assert(obj == false); assert(obj == false);
obj.store(true, std::memory_order_release); obj.store(true, std::memory_order_release);
@ -178,6 +180,7 @@ int main()
std::atomic_init(&obj, true); std::atomic_init(&obj, true);
assert(obj == true); assert(obj == true);
bool b0 = obj.is_lock_free(); bool b0 = obj.is_lock_free();
(void)b0; // to placate scan-build
obj.store(false); obj.store(false);
assert(obj == false); assert(obj == false);
obj.store(true, std::memory_order_release); obj.store(true, std::memory_order_release);

View File

@ -71,6 +71,7 @@ int main()
assert(next(m.begin(), 5)->second == 2); assert(next(m.begin(), 5)->second == 2);
i = m.erase(3); i = m.erase(3);
assert(i == 3);
assert(m.size() == 3); assert(m.size() == 3);
assert(next(m.begin(), 0)->first == 1); assert(next(m.begin(), 0)->first == 1);
assert(next(m.begin(), 0)->second == 1); assert(next(m.begin(), 0)->second == 1);
@ -135,6 +136,7 @@ int main()
assert(next(m.begin(), 5)->second == 2); assert(next(m.begin(), 5)->second == 2);
i = m.erase(3); i = m.erase(3);
assert(i == 3);
assert(m.size() == 3); assert(m.size() == 3);
assert(next(m.begin(), 0)->first == 1); assert(next(m.begin(), 0)->first == 1);
assert(next(m.begin(), 0)->second == 1); assert(next(m.begin(), 0)->second == 1);

View File

@ -30,5 +30,6 @@ int main()
typedef std::array<T, 0> C; typedef std::array<T, 0> C;
C c = {}; C c = {};
T* p = c.data(); T* p = c.data();
(void)p; // to placate scan-build
} }
} }

View File

@ -30,5 +30,6 @@ int main()
typedef std::array<T, 0> C; typedef std::array<T, 0> C;
const C c = {}; const C c = {};
const T* p = c.data(); const T* p = c.data();
(void)p; // to placate scan-build
} }
} }

View File

@ -19,4 +19,5 @@ int main()
{ {
std::complex<double> cd; std::complex<double> cd;
double x = sin(1.0); double x = sin(1.0);
(void)x; // to placate scan-build
} }