diff options
Diffstat (limited to 'test/std/numerics')
50 files changed, 134 insertions, 159 deletions
diff --git a/test/std/numerics/c.math/ctgmath.pass.cpp b/test/std/numerics/c.math/ctgmath.pass.cpp index 9e10690e3cac..24908ff03dc7 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<double> 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 4b89414686ba..3e215c8bf3c9 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<double> d; + (void)d; } diff --git a/test/std/numerics/complex.number/complex.transcendentals/acos.pass.cpp b/test/std/numerics/complex.number/complex.transcendentals/acos.pass.cpp index 1b0cca0d5f69..837734fcde9f 100644 --- a/test/std/numerics/complex.number/complex.transcendentals/acos.pass.cpp +++ b/test/std/numerics/complex.number/complex.transcendentals/acos.pass.cpp @@ -34,7 +34,6 @@ test() void test_edges() { - typedef std::complex<double> C; const double pi = std::atan2(+0., -0.); const unsigned N = sizeof(testcases) / sizeof(testcases[0]); for (unsigned i = 0; i < N; ++i) diff --git a/test/std/numerics/complex.number/complex.transcendentals/acosh.pass.cpp b/test/std/numerics/complex.number/complex.transcendentals/acosh.pass.cpp index f1aece20e6cf..deb056d67dec 100644 --- a/test/std/numerics/complex.number/complex.transcendentals/acosh.pass.cpp +++ b/test/std/numerics/complex.number/complex.transcendentals/acosh.pass.cpp @@ -34,7 +34,6 @@ test() void test_edges() { - typedef std::complex<double> C; const double pi = std::atan2(+0., -0.); const unsigned N = sizeof(testcases) / sizeof(testcases[0]); for (unsigned i = 0; i < N; ++i) diff --git a/test/std/numerics/complex.number/complex.transcendentals/asin.pass.cpp b/test/std/numerics/complex.number/complex.transcendentals/asin.pass.cpp index 2b213094df25..8d7462141d79 100644 --- a/test/std/numerics/complex.number/complex.transcendentals/asin.pass.cpp +++ b/test/std/numerics/complex.number/complex.transcendentals/asin.pass.cpp @@ -34,7 +34,6 @@ test() void test_edges() { - typedef std::complex<double> C; const double pi = std::atan2(+0., -0.); const unsigned N = sizeof(testcases) / sizeof(testcases[0]); for (unsigned i = 0; i < N; ++i) diff --git a/test/std/numerics/complex.number/complex.transcendentals/asinh.pass.cpp b/test/std/numerics/complex.number/complex.transcendentals/asinh.pass.cpp index 011f9d6b4f2e..3da56c32f198 100644 --- a/test/std/numerics/complex.number/complex.transcendentals/asinh.pass.cpp +++ b/test/std/numerics/complex.number/complex.transcendentals/asinh.pass.cpp @@ -34,7 +34,6 @@ test() void test_edges() { - typedef std::complex<double> C; const double pi = std::atan2(+0., -0.); const unsigned N = sizeof(testcases) / sizeof(testcases[0]); for (unsigned i = 0; i < N; ++i) diff --git a/test/std/numerics/complex.number/complex.transcendentals/atanh.pass.cpp b/test/std/numerics/complex.number/complex.transcendentals/atanh.pass.cpp index 6dc6034ca3c6..37e00c3925a6 100644 --- a/test/std/numerics/complex.number/complex.transcendentals/atanh.pass.cpp +++ b/test/std/numerics/complex.number/complex.transcendentals/atanh.pass.cpp @@ -34,7 +34,6 @@ test() void test_edges() { - typedef std::complex<double> C; const double pi = std::atan2(+0., -0.); const unsigned N = sizeof(testcases) / sizeof(testcases[0]); for (unsigned i = 0; i < N; ++i) diff --git a/test/std/numerics/complex.number/complex.transcendentals/cos.pass.cpp b/test/std/numerics/complex.number/complex.transcendentals/cos.pass.cpp index 03ed727cab8c..be9d505b9e27 100644 --- a/test/std/numerics/complex.number/complex.transcendentals/cos.pass.cpp +++ b/test/std/numerics/complex.number/complex.transcendentals/cos.pass.cpp @@ -34,7 +34,6 @@ test() void test_edges() { - typedef std::complex<double> C; const unsigned N = sizeof(testcases) / sizeof(testcases[0]); for (unsigned i = 0; i < N; ++i) { diff --git a/test/std/numerics/complex.number/complex.transcendentals/cosh.pass.cpp b/test/std/numerics/complex.number/complex.transcendentals/cosh.pass.cpp index a2c55390f2a8..dad5bd190aa8 100644 --- a/test/std/numerics/complex.number/complex.transcendentals/cosh.pass.cpp +++ b/test/std/numerics/complex.number/complex.transcendentals/cosh.pass.cpp @@ -34,7 +34,6 @@ test() void test_edges() { - typedef std::complex<double> C; const unsigned N = sizeof(testcases) / sizeof(testcases[0]); for (unsigned i = 0; i < N; ++i) { diff --git a/test/std/numerics/complex.number/complex.transcendentals/sin.pass.cpp b/test/std/numerics/complex.number/complex.transcendentals/sin.pass.cpp index 7ae59980b09d..0ab8ac275630 100644 --- a/test/std/numerics/complex.number/complex.transcendentals/sin.pass.cpp +++ b/test/std/numerics/complex.number/complex.transcendentals/sin.pass.cpp @@ -34,7 +34,6 @@ test() void test_edges() { - typedef std::complex<double> C; const unsigned N = sizeof(testcases) / sizeof(testcases[0]); for (unsigned i = 0; i < N; ++i) { diff --git a/test/std/numerics/complex.number/complex.transcendentals/sinh.pass.cpp b/test/std/numerics/complex.number/complex.transcendentals/sinh.pass.cpp index 491f3fac5738..e310f26dc9b4 100644 --- a/test/std/numerics/complex.number/complex.transcendentals/sinh.pass.cpp +++ b/test/std/numerics/complex.number/complex.transcendentals/sinh.pass.cpp @@ -34,7 +34,6 @@ test() void test_edges() { - typedef std::complex<double> C; const unsigned N = sizeof(testcases) / sizeof(testcases[0]); for (unsigned i = 0; i < N; ++i) { diff --git a/test/std/numerics/complex.number/complex.transcendentals/tanh.pass.cpp b/test/std/numerics/complex.number/complex.transcendentals/tanh.pass.cpp index 8fa419c2179d..1028836f98da 100644 --- a/test/std/numerics/complex.number/complex.transcendentals/tanh.pass.cpp +++ b/test/std/numerics/complex.number/complex.transcendentals/tanh.pass.cpp @@ -34,7 +34,6 @@ test() void test_edges() { - typedef std::complex<double> C; const unsigned N = sizeof(testcases) / sizeof(testcases[0]); for (unsigned i = 0; i < N; ++i) { diff --git a/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp b/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp index af5b1f0d3717..5c422300e343 100644 --- a/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp +++ b/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp @@ -13,7 +13,7 @@ // template<class InputIterator, class OutputIterator, class T> // OutputIterator inclusive_scan(InputIterator first, InputIterator last, // OutputIterator result, T init); -// +// #include <numeric> #include <vector> @@ -26,7 +26,7 @@ void test(Iter1 first, Iter1 last, Iter2 rFirst, Iter2 rLast) { std::vector<typename std::iterator_traits<Iter1>::value_type> v; - + // Not in place std::inclusive_scan(first, last, std::back_inserter(v)); assert(std::equal(v.begin(), v.end(), rFirst, rLast)); @@ -35,7 +35,7 @@ test(Iter1 first, Iter1 last, Iter2 rFirst, Iter2 rLast) v.clear(); v.assign(first, last); std::inclusive_scan(v.begin(), v.end(), v.begin()); - assert(std::equal(v.begin(), v.end(), rFirst, rLast)); + assert(std::equal(v.begin(), v.end(), rFirst, rLast)); } diff --git a/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp b/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp index 95db56bf67d2..2c6eacc1682f 100644 --- a/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp +++ b/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp @@ -13,7 +13,7 @@ // template<class InputIterator, class OutputIterator, class T, class BinaryOperation> // OutputIterator // inclusive_scan(InputIterator first, InputIterator last, -// OutputIterator result, +// OutputIterator result, // BinaryOperation binary_op); // C++17 #include <numeric> @@ -37,7 +37,7 @@ test(Iter1 first, Iter1 last, Op op, Iter2 rFirst, Iter2 rLast) v.clear(); v.assign(first, last); std::inclusive_scan(v.begin(), v.end(), v.begin(), op); - assert(std::equal(v.begin(), v.end(), rFirst, rLast)); + assert(std::equal(v.begin(), v.end(), rFirst, rLast)); } @@ -99,7 +99,7 @@ int main() { basic_tests(); - + // All the iterator categories // test<input_iterator <const int*> >(); // test<forward_iterator <const int*> >(); @@ -109,4 +109,3 @@ int main() // test< int*>(); } -
\ No newline at end of file diff --git a/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp b/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp index 04913f904885..653578055c69 100644 --- a/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp +++ b/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp @@ -13,7 +13,7 @@ // template<class InputIterator, class OutputIterator, class T, class BinaryOperation> // OutputIterator // inclusive_scan(InputIterator first, InputIterator last, -// OutputIterator result, +// OutputIterator result, // BinaryOperation binary_op, T init); // C++17 #include <numeric> @@ -36,7 +36,7 @@ test(Iter1 first, Iter1 last, Op op, T init, Iter2 rFirst, Iter2 rLast) v.clear(); v.assign(first, last); std::inclusive_scan(v.begin(), v.end(), v.begin(), op, init); - assert(std::equal(v.begin(), v.end(), rFirst, rLast)); + assert(std::equal(v.begin(), v.end(), rFirst, rLast)); } @@ -115,7 +115,7 @@ int main() { basic_tests(); - + // All the iterator categories test<input_iterator <const int*> >(); test<forward_iterator <const int*> >(); @@ -125,4 +125,3 @@ int main() test< int*>(); } -
\ No newline at end of file diff --git a/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp b/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp index 6bd8a4f1e610..d96ca3225aa3 100644 --- a/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp +++ b/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp @@ -19,6 +19,7 @@ #include <cstdint> #include <cstdlib> #include <type_traits> +#include "test_macros.h" constexpr struct { int x; @@ -137,7 +138,7 @@ int main() // LWG#2837 { auto res1 = std::lcm(static_cast<std::int64_t>(1234), INT32_MIN); - (void)std::lcm(INT_MIN, 2UL); // this used to trigger UBSAN + TEST_IGNORE_NODISCARD std::lcm(INT_MIN, 2UL); // this used to trigger UBSAN static_assert(std::is_same_v<decltype(res1), std::int64_t>, ""); assert(res1 == 1324997410816LL); } diff --git a/test/std/numerics/numeric.ops/reduce/reduce_init_op.pass.cpp b/test/std/numerics/numeric.ops/reduce/reduce_init_op.pass.cpp index e3e2ffe7be0c..cff1b8c0ab4e 100644 --- a/test/std/numerics/numeric.ops/reduce/reduce_init_op.pass.cpp +++ b/test/std/numerics/numeric.ops/reduce/reduce_init_op.pass.cpp @@ -65,10 +65,10 @@ int main() test<random_access_iterator<const int*> >(); test<const int*>(); -// Make sure the math is done using the correct type +// Make sure the math is done using the correct type { auto v = {1, 2, 3, 4, 5, 6, 7, 8}; unsigned res = std::reduce(v.begin(), v.end(), 1U, std::multiplies<>()); - assert(res == 40320); // 8! will not fit into a char + assert(res == 40320); // 8! will not fit into a char } } diff --git a/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp b/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp index d96d4d6ec439..4964e8e884bd 100644 --- a/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp +++ b/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp @@ -25,20 +25,20 @@ #include "test_iterators.h" -template <class _Tp = void> -struct identity : std::unary_function<_Tp, _Tp> +template <class T = void> +struct identity : std::unary_function<T, T> { - constexpr const _Tp& operator()(const _Tp& __x) const { return __x;} + constexpr const T& operator()(const T& x) const { return x;} }; template <> struct identity<void> { - template <class _Tp> - constexpr auto operator()(_Tp&& __x) const - _NOEXCEPT_(noexcept(_VSTD::forward<_Tp>(__x))) - -> decltype (_VSTD::forward<_Tp>(__x)) - { return _VSTD::forward<_Tp>(__x); } + template <class T> + constexpr auto operator()(T&& x) const + _NOEXCEPT_(noexcept(_VSTD::forward<T>(x))) + -> decltype (_VSTD::forward<T>(x)) + { return _VSTD::forward<T>(x); } }; template <class Iter1, class BOp, class UOp, class T, class Iter2> diff --git a/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp b/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp index b96218d7da4f..d15defc2cabc 100644 --- a/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp +++ b/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp @@ -1,3 +1,4 @@ + //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure @@ -10,7 +11,7 @@ // <numeric> // UNSUPPORTED: c++98, c++03, c++11, c++14 -// template<class InputIterator, class OutputIterator, class T, +// template<class InputIterator, class OutputIterator, class T, // class BinaryOperation, class UnaryOperation> // OutputIterator transform_inclusive_scan(InputIterator first, InputIterator last, // OutputIterator result, @@ -25,20 +26,20 @@ #include "test_iterators.h" -template <class _Tp = void> -struct identity : std::unary_function<_Tp, _Tp> +template <class T = void> +struct identity : std::unary_function<T, T> { - constexpr const _Tp& operator()(const _Tp& __x) const { return __x;} + constexpr const T& operator()(const T& x) const { return x;} }; template <> struct identity<void> { - template <class _Tp> - constexpr auto operator()(_Tp&& __x) const - _NOEXCEPT_(noexcept(_VSTD::forward<_Tp>(__x))) - -> decltype (_VSTD::forward<_Tp>(__x)) - { return _VSTD::forward<_Tp>(__x); } + template <class T> + constexpr auto operator()(T&& x) const + _NOEXCEPT_(noexcept(_VSTD::forward<T>(x))) + -> decltype (_VSTD::forward<T>(x)) + { return _VSTD::forward<T>(x); } }; template <class Iter1, class BOp, class UOp, class Iter2> @@ -64,7 +65,7 @@ test() { int ia[] = { 1, 3, 5, 7, 9}; const int pResI0[] = { 1, 4, 9, 16, 25}; // with identity - const int mResI0[] = { 1, 3, 15, 105, 945}; + const int mResI0[] = { 1, 3, 15, 105, 945}; const int pResN0[] = { -1, -4, -9, -16, -25}; // with negate const int mResN0[] = { -1, 3, -15, 105, -945}; const unsigned sa = sizeof(ia) / sizeof(ia[0]); @@ -90,8 +91,8 @@ void basic_tests() std::vector<int> v(10); std::fill(v.begin(), v.end(), 3); std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), identity<>()); - std::copy(v.begin(), v.end(), std::ostream_iterator<int>(std::cout, " ")); - std::cout << std::endl; + std::copy(v.begin(), v.end(), std::ostream_iterator<int>(std::cout, " ")); + std::cout << std::endl; for (size_t i = 0; i < v.size(); ++i) assert(v[i] == (int)(i+1) * 3); } @@ -122,7 +123,7 @@ void basic_tests() int main() { basic_tests(); - + // All the iterator categories test<input_iterator <const int*> >(); test<forward_iterator <const int*> >(); diff --git a/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp b/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp index df68946a5e65..b38b9a5afedf 100644 --- a/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp +++ b/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp @@ -10,7 +10,7 @@ // <numeric> // UNSUPPORTED: c++98, c++03, c++11, c++14 -// template<class InputIterator, class OutputIterator, class T, +// template<class InputIterator, class OutputIterator, class T, // class BinaryOperation, class UnaryOperation> // OutputIterator transform_inclusive_scan(InputIterator first, InputIterator last, // OutputIterator result, @@ -25,20 +25,20 @@ #include "test_iterators.h" -template <class _Tp = void> -struct identity : std::unary_function<_Tp, _Tp> +template <class T = void> +struct identity : std::unary_function<T, T> { - constexpr const _Tp& operator()(const _Tp& __x) const { return __x;} + constexpr const T& operator()(const T& x) const { return x;} }; template <> struct identity<void> { - template <class _Tp> - constexpr auto operator()(_Tp&& __x) const - _NOEXCEPT_(noexcept(_VSTD::forward<_Tp>(__x))) - -> decltype (_VSTD::forward<_Tp>(__x)) - { return _VSTD::forward<_Tp>(__x); } + template <class T> + constexpr auto operator()(T&& x) const + _NOEXCEPT_(noexcept(_VSTD::forward<T>(x))) + -> decltype (_VSTD::forward<T>(x)) + { return _VSTD::forward<T>(x); } }; template <class Iter1, class BOp, class UOp, class T, class Iter2> @@ -64,11 +64,11 @@ test() { int ia[] = { 1, 3, 5, 7, 9}; const int pResI0[] = { 1, 4, 9, 16, 25}; // with identity - const int mResI0[] = { 0, 0, 0, 0, 0}; + const int mResI0[] = { 0, 0, 0, 0, 0}; const int pResN0[] = { -1, -4, -9, -16, -25}; // with negate const int mResN0[] = { 0, 0, 0, 0, 0}; const int pResI2[] = { 3, 6, 11, 18, 27}; // with identity - const int mResI2[] = { 2, 6, 30, 210, 1890}; + const int mResI2[] = { 2, 6, 30, 210, 1890}; const int pResN2[] = { 1, -2, -7, -14, -23}; // with negate const int mResN2[] = { -2, 6, -30, 210, -1890}; const unsigned sa = sizeof(ia) / sizeof(ia[0]); @@ -149,7 +149,7 @@ void basic_tests() int main() { basic_tests(); - + // All the iterator categories test<input_iterator <const int*> >(); test<forward_iterator <const int*> >(); diff --git a/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_init_bop_uop.pass.cpp b/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_init_bop_uop.pass.cpp index b05792ddeb55..418c57f7cfca 100644 --- a/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_init_bop_uop.pass.cpp +++ b/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_init_bop_uop.pass.cpp @@ -21,37 +21,37 @@ #include "test_iterators.h" -template <class _Tp = void> -struct identity : std::unary_function<_Tp, _Tp> +template <class T = void> +struct identity : std::unary_function<T, T> { - constexpr const _Tp& operator()(const _Tp& __x) const { return __x;} + constexpr const T& operator()(const T& x) const { return x;} }; template <> struct identity<void> { - template <class _Tp> - constexpr auto operator()(_Tp&& __x) const - _NOEXCEPT_(noexcept(_VSTD::forward<_Tp>(__x))) - -> decltype (_VSTD::forward<_Tp>(__x)) - { return _VSTD::forward<_Tp>(__x); } + template <class T> + constexpr auto operator()(T&& x) const + _NOEXCEPT_(noexcept(_VSTD::forward<T>(x))) + -> decltype (_VSTD::forward<T>(x)) + { return _VSTD::forward<T>(x); } }; -template <class _Tp = void> +template <class T = void> struct twice { - constexpr const _Tp operator()(const _Tp& __x) const noexcept { return 2 * __x; } + constexpr const T operator()(const T& x) const noexcept { return 2 * x; } }; template <> struct twice<void> { - template <class _Tp> - constexpr auto operator()(const _Tp& __x) const - _NOEXCEPT_(noexcept(2 * __x)) - -> decltype (2 * __x) - { return 2 * __x; } + template <class T> + constexpr auto operator()(const T& x) const + _NOEXCEPT_(noexcept(2 * x)) + -> decltype (2 * x) + { return 2 * x; } }; template <class Iter1, class T, class BOp, class UOp> @@ -115,10 +115,10 @@ int main() test<const int*>(); test< int*>(); -// Make sure the math is done using the correct type +// Make sure the math is done using the correct type { auto v = {1, 2, 3, 4, 5, 6}; unsigned res = std::transform_reduce(v.begin(), v.end(), 1U, std::multiplies<>(), twice<>()); - assert(res == 46080); // 6! * 64 will not fit into a char + assert(res == 46080); // 6! * 64 will not fit into a char } } diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.disc/assign.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.disc/assign.pass.cpp index 18c8947af6ee..5238915ee89f 100644 --- a/test/std/numerics/rand/rand.adapt/rand.adapt.disc/assign.pass.cpp +++ b/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/test/std/numerics/rand/rand.adapt/rand.adapt.disc/copy.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.disc/copy.pass.cpp index d6c64fa37dcc..80417e5d6d73 100644 --- a/test/std/numerics/rand/rand.adapt/rand.adapt.disc/copy.pass.cpp +++ b/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/test/std/numerics/rand/rand.adapt/rand.adapt.disc/discard.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.disc/discard.pass.cpp index 2dada0d6345f..d10b7c5e8a31 100644 --- a/test/std/numerics/rand/rand.adapt/rand.adapt.disc/discard.pass.cpp +++ b/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/test/std/numerics/rand/rand.adapt/rand.adapt.disc/values.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.disc/values.pass.cpp index 8cc523e2fc07..5666fdce28d6 100644 --- a/test/std/numerics/rand/rand.adapt/rand.adapt.disc/values.pass.cpp +++ b/test/std/numerics/rand/rand.adapt/rand.adapt.disc/values.pass.cpp @@ -28,8 +28,8 @@ #include "test_macros.h" -template <class _Tp> -void where(const _Tp &) {} +template <class T> +void where(const T &) {} void test1() diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/assign.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/assign.pass.cpp index e4cd4f7396be..4484b3db4e4e 100644 --- a/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/assign.pass.cpp +++ b/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/assign.pass.cpp @@ -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); diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/copy.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/copy.pass.cpp index e3e497ec8c6e..6a01af4bf39c 100644 --- a/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/copy.pass.cpp +++ b/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/copy.pass.cpp @@ -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()); diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/discard.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/discard.pass.cpp index 2a356a1c80db..a1b4dd7d7aee 100644 --- a/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/discard.pass.cpp +++ b/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/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/assign.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/assign.pass.cpp index dae8c7c919af..652e6487a4e0 100644 --- a/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/assign.pass.cpp +++ b/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/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/copy.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/copy.pass.cpp index c9e9893dee4b..de26e2dc7861 100644 --- a/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/copy.pass.cpp +++ b/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/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_copy.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_copy.pass.cpp index a20c494f334c..e71aa1d893bd 100644 --- a/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_copy.pass.cpp +++ b/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/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_move.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_move.pass.cpp index 9811787821d9..4a347b5d5b8e 100644 --- a/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/ctor_engine_move.pass.cpp +++ b/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/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/discard.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/discard.pass.cpp index 6e04e26c7e55..b442a76adb63 100644 --- a/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/discard.pass.cpp +++ b/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/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/values.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/values.pass.cpp index c592b6df2d6e..ac3f1d7112d1 100644 --- a/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/values.pass.cpp +++ b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/values.pass.cpp @@ -27,8 +27,8 @@ #include "test_macros.h" -template <class _Tp> -void where(const _Tp &) {} +template <class T> +void where(const T &) {} void test1() diff --git a/test/std/numerics/rand/rand.device/eval.pass.cpp b/test/std/numerics/rand/rand.device/eval.pass.cpp index b34e40c75273..56690316c129 100644 --- a/test/std/numerics/rand/rand.device/eval.pass.cpp +++ b/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/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/eval.pass.cpp index cfaddb73f0b8..82e8ffc77a40 100644 --- a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/eval.pass.cpp +++ b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/eval.pass.cpp @@ -33,7 +33,6 @@ void test1() { typedef std::lognormal_distribution<> D; - typedef D::param_type P; typedef std::mt19937 G; G g; D d(-1./8192, 0.015625); @@ -78,7 +77,6 @@ void test2() { typedef std::lognormal_distribution<> D; - typedef D::param_type P; typedef std::mt19937 G; G g; D d(-1./32, 0.25); @@ -123,7 +121,6 @@ void test3() { typedef std::lognormal_distribution<> D; - typedef D::param_type P; typedef std::mt19937 G; G g; D d(-1./8, 0.5); @@ -168,7 +165,6 @@ void test4() { typedef std::lognormal_distribution<> D; - typedef D::param_type P; typedef std::mt19937 G; G g; D d; @@ -213,7 +209,6 @@ void test5() { typedef std::lognormal_distribution<> D; - typedef D::param_type P; typedef std::mt19937 G; G g; D d(-0.78125, 1.25); diff --git a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/eval.pass.cpp index b207eece67d0..6ae2301807d6 100644 --- a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/eval.pass.cpp +++ b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/eval.pass.cpp @@ -33,7 +33,6 @@ int main() { { typedef std::student_t_distribution<> D; - typedef D::param_type P; typedef std::minstd_rand G; G g; D d(5.5); @@ -69,7 +68,6 @@ int main() } { typedef std::student_t_distribution<> D; - typedef D::param_type P; typedef std::minstd_rand G; G g; D d(10); @@ -105,7 +103,6 @@ int main() } { typedef std::student_t_distribution<> D; - typedef D::param_type P; typedef std::minstd_rand G; G g; D d(100); diff --git a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/eval.pass.cpp index 3999cbeccbb7..ecc663c6c90c 100644 --- a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/eval.pass.cpp +++ b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/eval.pass.cpp @@ -33,7 +33,6 @@ void test1() { typedef std::extreme_value_distribution<> D; - typedef D::param_type P; typedef std::mt19937 G; G g; D d(0.5, 2); @@ -75,7 +74,6 @@ void test2() { typedef std::extreme_value_distribution<> D; - typedef D::param_type P; typedef std::mt19937 G; G g; D d(1, 2); @@ -117,7 +115,6 @@ void test3() { typedef std::extreme_value_distribution<> D; - typedef D::param_type P; typedef std::mt19937 G; G g; D d(1.5, 3); @@ -159,7 +156,6 @@ void test4() { typedef std::extreme_value_distribution<> D; - typedef D::param_type P; typedef std::mt19937 G; G g; D d(3, 4); diff --git a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/eval.pass.cpp index d0ac16298e42..15d3a289b570 100644 --- a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/eval.pass.cpp +++ b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/eval.pass.cpp @@ -33,7 +33,6 @@ int main() { { typedef std::gamma_distribution<> D; - typedef D::param_type P; typedef std::mt19937 G; G g; D d(0.5, 2); @@ -73,7 +72,6 @@ int main() } { typedef std::gamma_distribution<> D; - typedef D::param_type P; typedef std::mt19937 G; G g; D d(1, .5); @@ -113,7 +111,6 @@ int main() } { typedef std::gamma_distribution<> D; - typedef D::param_type P; typedef std::mt19937 G; G g; D d(2, 3); diff --git a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp index 7da4b9bfb1e5..d97898e5f446 100644 --- a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp +++ b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp @@ -44,7 +44,6 @@ void test1() { typedef std::piecewise_linear_distribution<> D; - typedef D::param_type P; typedef std::mt19937_64 G; G g; double b[] = {10, 14, 16, 17}; @@ -97,7 +96,6 @@ void test2() { typedef std::piecewise_linear_distribution<> D; - typedef D::param_type P; typedef std::mt19937_64 G; G g; double b[] = {10, 14, 16, 17}; @@ -150,7 +148,6 @@ void test3() { typedef std::piecewise_linear_distribution<> D; - typedef D::param_type P; typedef std::mt19937_64 G; G g; double b[] = {10, 14, 16, 17}; @@ -203,7 +200,6 @@ void test4() { typedef std::piecewise_linear_distribution<> D; - typedef D::param_type P; typedef std::mt19937_64 G; G g; double b[] = {10, 14, 16}; @@ -257,7 +253,6 @@ void test5() { typedef std::piecewise_linear_distribution<> D; - typedef D::param_type P; typedef std::mt19937_64 G; G g; double b[] = {10, 14}; @@ -312,7 +307,6 @@ void test6() { typedef std::piecewise_linear_distribution<> D; - typedef D::param_type P; typedef std::mt19937_64 G; G g; double b[] = {10, 14, 16, 17}; diff --git a/test/std/numerics/rand/rand.eng/rand.eng.lcong/discard.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.lcong/discard.pass.cpp index 9e3372a8c2b4..0a36fcb71a72 100644 --- a/test/std/numerics/rand/rand.eng/rand.eng.lcong/discard.pass.cpp +++ b/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/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp index 2080ac5f41de..72d5854b7655 100644 --- a/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp +++ b/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp @@ -27,8 +27,8 @@ #include "test_macros.h" -template <class _Tp> -void where(const _Tp &) {} +template <class T> +void where(const T &) {} template <class T, T a, T c, T m> void diff --git a/test/std/numerics/rand/rand.eng/rand.eng.mers/assign.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.mers/assign.pass.cpp index fda5b88de26e..63d7168f5bf4 100644 --- a/test/std/numerics/rand/rand.eng/rand.eng.mers/assign.pass.cpp +++ b/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/test/std/numerics/rand/rand.eng/rand.eng.mers/copy.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.mers/copy.pass.cpp index 57c015ccce1d..a006b33243c9 100644 --- a/test/std/numerics/rand/rand.eng/rand.eng.mers/copy.pass.cpp +++ b/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/test/std/numerics/rand/rand.eng/rand.eng.mers/discard.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.mers/discard.pass.cpp index d20d661d5891..480260d8bf45 100644 --- a/test/std/numerics/rand/rand.eng/rand.eng.mers/discard.pass.cpp +++ b/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/test/std/numerics/rand/rand.eng/rand.eng.mers/values.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.mers/values.pass.cpp index f7834afd4454..08d99b3d8acb 100644 --- a/test/std/numerics/rand/rand.eng/rand.eng.mers/values.pass.cpp +++ b/test/std/numerics/rand/rand.eng/rand.eng.mers/values.pass.cpp @@ -42,8 +42,8 @@ #include "test_macros.h" -template <class _Tp> -void where(const _Tp &) {} +template <class T> +void where(const T &) {} void test1() diff --git a/test/std/numerics/rand/rand.eng/rand.eng.sub/assign.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.sub/assign.pass.cpp index 305d43ad4a22..60fec44629ec 100644 --- a/test/std/numerics/rand/rand.eng/rand.eng.sub/assign.pass.cpp +++ b/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/test/std/numerics/rand/rand.eng/rand.eng.sub/copy.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.sub/copy.pass.cpp index 27f88165bcf5..5944716b6ac4 100644 --- a/test/std/numerics/rand/rand.eng/rand.eng.sub/copy.pass.cpp +++ b/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/test/std/numerics/rand/rand.eng/rand.eng.sub/discard.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.sub/discard.pass.cpp index 4ba93819ee43..ad33fc15118c 100644 --- a/test/std/numerics/rand/rand.eng/rand.eng.sub/discard.pass.cpp +++ b/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/test/std/numerics/rand/rand.eng/rand.eng.sub/values.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.sub/values.pass.cpp index 6b8b4eed97a9..02f8b222d7d3 100644 --- a/test/std/numerics/rand/rand.eng/rand.eng.sub/values.pass.cpp +++ b/test/std/numerics/rand/rand.eng/rand.eng.sub/values.pass.cpp @@ -30,8 +30,8 @@ #include "test_macros.h" -template <class _Tp> -void where(const _Tp &) {} +template <class T> +void where(const T &) {} void test1() |