From 5384fd8538d1dff4cf4884b8708c00cf8dde3d4d Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sat, 14 Oct 2017 15:52:38 +0000 Subject: [PATCH] Placate unused variable warnings uncovered by improvements to clang's -Wunused-variable git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@315809 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/libcxx/depr/depr.c.headers/complex.h.pass.cpp | 1 + test/libcxx/depr/depr.c.headers/tgmath_h.pass.cpp | 1 + test/libcxx/numerics/complex.number/ccmplx/ccomplex.pass.cpp | 1 + test/std/depr/depr.c.headers/complex.h.pass.cpp | 1 + test/std/depr/depr.c.headers/tgmath_h.pass.cpp | 1 + .../optional.syn/optional_includes_initializer_list.pass.cpp | 1 + .../utilities/tuple/header.tuple.synop/includes.pass.cpp | 1 + .../move.iter.ops/move.iter.op.const/default.pass.cpp | 2 ++ .../reverse.iter.ops/reverse.iter.cons/default.pass.cpp | 2 ++ .../istream.iterator/istream.iterator.cons/default.pass.cpp | 2 ++ .../istreambuf.iterator.cons/default.pass.cpp | 2 ++ .../support.initlist/support.initlist.access/access.pass.cpp | 1 + .../support.initlist/support.initlist.range/begin_end.pass.cpp | 1 + test/std/numerics/c.math/ctgmath.pass.cpp | 1 + test/std/numerics/complex.number/ccmplx/ccomplex.pass.cpp | 1 + .../thread.once/thread.once.onceflag/default.pass.cpp | 2 ++ .../optional.syn/optional_includes_initializer_list.pass.cpp | 1 + .../std/utilities/tuple/tuple.tuple/tuple.cnstr/UTypes.pass.cpp | 1 + test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc.pass.cpp | 2 ++ .../utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp | 2 ++ test/std/utilities/utility/synopsis.pass.cpp | 1 + 21 files changed, 28 insertions(+) diff --git a/test/libcxx/depr/depr.c.headers/complex.h.pass.cpp b/test/libcxx/depr/depr.c.headers/complex.h.pass.cpp index da0707990..7abe8e0a0 100644 --- a/test/libcxx/depr/depr.c.headers/complex.h.pass.cpp +++ b/test/libcxx/depr/depr.c.headers/complex.h.pass.cpp @@ -18,4 +18,5 @@ int main() { std::complex d; + (void)d; } diff --git a/test/libcxx/depr/depr.c.headers/tgmath_h.pass.cpp b/test/libcxx/depr/depr.c.headers/tgmath_h.pass.cpp index a2ef814dc..931e3a32f 100644 --- a/test/libcxx/depr/depr.c.headers/tgmath_h.pass.cpp +++ b/test/libcxx/depr/depr.c.headers/tgmath_h.pass.cpp @@ -18,6 +18,7 @@ int main() { std::complex cd; + (void)cd; double x = sin(1.0); (void)x; // to placate scan-build } diff --git a/test/libcxx/numerics/complex.number/ccmplx/ccomplex.pass.cpp b/test/libcxx/numerics/complex.number/ccmplx/ccomplex.pass.cpp index 21aaa669f..cc98517b9 100644 --- a/test/libcxx/numerics/complex.number/ccmplx/ccomplex.pass.cpp +++ b/test/libcxx/numerics/complex.number/ccmplx/ccomplex.pass.cpp @@ -18,4 +18,5 @@ int main() { std::complex d; + (void)d; } diff --git a/test/std/depr/depr.c.headers/complex.h.pass.cpp b/test/std/depr/depr.c.headers/complex.h.pass.cpp index 0e3fd3e99..4effd9653 100644 --- a/test/std/depr/depr.c.headers/complex.h.pass.cpp +++ b/test/std/depr/depr.c.headers/complex.h.pass.cpp @@ -14,4 +14,5 @@ int main() { std::complex d; + (void)d; } diff --git a/test/std/depr/depr.c.headers/tgmath_h.pass.cpp b/test/std/depr/depr.c.headers/tgmath_h.pass.cpp index 965a8de3c..91727b6cc 100644 --- a/test/std/depr/depr.c.headers/tgmath_h.pass.cpp +++ b/test/std/depr/depr.c.headers/tgmath_h.pass.cpp @@ -14,6 +14,7 @@ int main() { std::complex cd; + (void)cd; double x = sin(1.0); (void)x; // to placate scan-build } diff --git a/test/std/experimental/optional/optional.syn/optional_includes_initializer_list.pass.cpp b/test/std/experimental/optional/optional.syn/optional_includes_initializer_list.pass.cpp index 8cf11b553..b8fba47f7 100644 --- a/test/std/experimental/optional/optional.syn/optional_includes_initializer_list.pass.cpp +++ b/test/std/experimental/optional/optional.syn/optional_includes_initializer_list.pass.cpp @@ -19,4 +19,5 @@ int main() using std::experimental::optional; std::initializer_list list; + (void)list; } diff --git a/test/std/experimental/utilities/tuple/header.tuple.synop/includes.pass.cpp b/test/std/experimental/utilities/tuple/header.tuple.synop/includes.pass.cpp index d37557a7b..5cfb15e3d 100644 --- a/test/std/experimental/utilities/tuple/header.tuple.synop/includes.pass.cpp +++ b/test/std/experimental/utilities/tuple/header.tuple.synop/includes.pass.cpp @@ -16,4 +16,5 @@ int main() { std::tuple x(1); + (void)x; } diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/default.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/default.pass.cpp index ba1406ada..404e02cd7 100644 --- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/default.pass.cpp +++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/default.pass.cpp @@ -25,6 +25,7 @@ void test() { std::move_iterator r; + (void)r; } int main() @@ -38,6 +39,7 @@ int main() #if TEST_STD_VER > 14 { constexpr std::move_iterator it; + (void)it; } #endif } diff --git a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/default.pass.cpp b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/default.pass.cpp index 2162f8c2b..88fd0def5 100644 --- a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/default.pass.cpp +++ b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/default.pass.cpp @@ -25,6 +25,7 @@ void test() { std::reverse_iterator r; + (void)r; } int main() @@ -37,6 +38,7 @@ int main() #if TEST_STD_VER > 14 { constexpr std::reverse_iterator it; + (void)it; } #endif } diff --git a/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/default.pass.cpp b/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/default.pass.cpp index 22f2967f3..10bba08ea 100644 --- a/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/default.pass.cpp +++ b/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/default.pass.cpp @@ -32,6 +32,7 @@ template it; + (void)it; } }; @@ -50,6 +51,7 @@ int main() assert(it == T()); #if TEST_STD_VER >= 11 constexpr T it2; + (void)it2; #endif } diff --git a/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/default.pass.cpp b/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/default.pass.cpp index 74aa6f2ab..c71ee4099 100644 --- a/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/default.pass.cpp +++ b/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/default.pass.cpp @@ -30,6 +30,7 @@ int main() assert(it == T()); #if TEST_STD_VER >= 11 constexpr T it2; + (void)it2; #endif } { @@ -38,6 +39,7 @@ int main() assert(it == T()); #if TEST_STD_VER >= 11 constexpr T it2; + (void)it2; #endif } } diff --git a/test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp b/test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp index f6fd5564f..cadae24cb 100644 --- a/test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp +++ b/test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp @@ -57,5 +57,6 @@ int main() A test1 = {3, 2, 1}; #if TEST_STD_VER > 11 constexpr B test2 = {3, 2, 1}; + (void)test2; #endif // TEST_STD_VER > 11 } diff --git a/test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp b/test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp index 102ed64fe..abb07dc99 100644 --- a/test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp +++ b/test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp @@ -55,5 +55,6 @@ int main() A test1 = {3, 2, 1}; #if TEST_STD_VER > 11 constexpr B test2 = {3, 2, 1}; + (void)test2; #endif // TEST_STD_VER > 11 } diff --git a/test/std/numerics/c.math/ctgmath.pass.cpp b/test/std/numerics/c.math/ctgmath.pass.cpp index 9e10690e3..24908ff03 100644 --- a/test/std/numerics/c.math/ctgmath.pass.cpp +++ b/test/std/numerics/c.math/ctgmath.pass.cpp @@ -14,6 +14,7 @@ int main() { std::complex cd; + (void)cd; double x = std::sin(0); ((void)x); // Prevent unused warning } diff --git a/test/std/numerics/complex.number/ccmplx/ccomplex.pass.cpp b/test/std/numerics/complex.number/ccmplx/ccomplex.pass.cpp index 4b8941468..3e215c8bf 100644 --- a/test/std/numerics/complex.number/ccmplx/ccomplex.pass.cpp +++ b/test/std/numerics/complex.number/ccmplx/ccomplex.pass.cpp @@ -14,4 +14,5 @@ int main() { std::complex d; + (void)d; } diff --git a/test/std/thread/thread.mutex/thread.once/thread.once.onceflag/default.pass.cpp b/test/std/thread/thread.mutex/thread.once/thread.once.onceflag/default.pass.cpp index 21011ed17..62f1b784b 100644 --- a/test/std/thread/thread.mutex/thread.once/thread.once.onceflag/default.pass.cpp +++ b/test/std/thread/thread.mutex/thread.once/thread.once.onceflag/default.pass.cpp @@ -20,10 +20,12 @@ int main() { { std::once_flag f; + (void)f; } #if TEST_STD_VER >= 11 { constexpr std::once_flag f; + (void)f; } #endif } diff --git a/test/std/utilities/optional/optional.syn/optional_includes_initializer_list.pass.cpp b/test/std/utilities/optional/optional.syn/optional_includes_initializer_list.pass.cpp index 687625e8b..57903020f 100644 --- a/test/std/utilities/optional/optional.syn/optional_includes_initializer_list.pass.cpp +++ b/test/std/utilities/optional/optional.syn/optional_includes_initializer_list.pass.cpp @@ -19,4 +19,5 @@ int main() using std::optional; std::initializer_list list; + (void)list; } diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/UTypes.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/UTypes.pass.cpp index 06284df56..fed27aa84 100644 --- a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/UTypes.pass.cpp +++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/UTypes.pass.cpp @@ -147,6 +147,7 @@ int main() #if TEST_STD_VER > 11 { constexpr std::tuple t0{Empty()}; + (void)t0; } { constexpr std::tuple t(3, 2); diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc.pass.cpp index b262f3cac..bf66da162 100644 --- a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc.pass.cpp +++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc.pass.cpp @@ -102,6 +102,8 @@ int main() using T = NonDefaultConstructible<>; T v(42); std::tuple t(v, v); + (void)t; std::tuple t2(42, 42); + (void)t2; } } diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp index fa2f116f7..731946608 100644 --- a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp +++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp @@ -49,6 +49,7 @@ int main() { { std::tuple<> t; + (void)t; } { std::tuple t; @@ -88,6 +89,7 @@ int main() } { constexpr std::tuple<> t; + (void)t; } { constexpr std::tuple t; diff --git a/test/std/utilities/utility/synopsis.pass.cpp b/test/std/utilities/utility/synopsis.pass.cpp index 5f5b4eeaa..009b65cbb 100644 --- a/test/std/utilities/utility/synopsis.pass.cpp +++ b/test/std/utilities/utility/synopsis.pass.cpp @@ -17,5 +17,6 @@ int main() { std::initializer_list x; + (void)x; }