diff options
Diffstat (limited to 'test/std/numerics')
14 files changed, 26 insertions, 26 deletions
diff --git a/test/std/numerics/complex.number/complex.transcendentals/atan.pass.cpp b/test/std/numerics/complex.number/complex.transcendentals/atan.pass.cpp index 8cc71f7bff275..9e2298cf77183 100644 --- a/test/std/numerics/complex.number/complex.transcendentals/atan.pass.cpp +++ b/test/std/numerics/complex.number/complex.transcendentals/atan.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/tan.pass.cpp b/test/std/numerics/complex.number/complex.transcendentals/tan.pass.cpp index 9f09ab5827dea..f27ead3daf002 100644 --- a/test/std/numerics/complex.number/complex.transcendentals/tan.pass.cpp +++ b/test/std/numerics/complex.number/complex.transcendentals/tan.pass.cpp @@ -35,7 +35,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/numarray/template.valarray/valarray.assign/move_assign.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.assign/move_assign.pass.cpp index d34ff1c64d83b..19b74ba28bcd0 100644 --- a/test/std/numerics/numarray/template.valarray/valarray.assign/move_assign.pass.cpp +++ b/test/std/numerics/numarray/template.valarray/valarray.assign/move_assign.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <valarray> // template<class T> class valarray; @@ -19,7 +21,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef int T; T a[] = {1, 2, 3, 4, 5}; @@ -60,5 +61,4 @@ int main() assert(v2[i][j] == a[i][j]); } } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/numerics/numarray/template.valarray/valarray.cons/move.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cons/move.pass.cpp index a9692618e75f7..b8fb08e0f2231 100644 --- a/test/std/numerics/numarray/template.valarray/valarray.cons/move.pass.cpp +++ b/test/std/numerics/numarray/template.valarray/valarray.cons/move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <valarray> // template<class T> class valarray; @@ -20,7 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef int T; T a[] = {1, 2, 3, 4, 5}; @@ -58,5 +59,4 @@ int main() assert(v2[i][j] == a[i][j]); } } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/numerics/numeric.ops/adjacent.difference/adjacent_difference.pass.cpp b/test/std/numerics/numeric.ops/adjacent.difference/adjacent_difference.pass.cpp index 46741e1e41b7b..f999c5045a5c1 100644 --- a/test/std/numerics/numeric.ops/adjacent.difference/adjacent_difference.pass.cpp +++ b/test/std/numerics/numeric.ops/adjacent.difference/adjacent_difference.pass.cpp @@ -22,6 +22,7 @@ #include <numeric> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" template <class InIter, class OutIter> @@ -38,7 +39,7 @@ test() assert(ib[i] == ir[i]); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#if TEST_STD_VER >= 11 class Y; @@ -107,7 +108,7 @@ int main() test<const int*, random_access_iterator<int*> >(); test<const int*, int*>(); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#if TEST_STD_VER >= 11 X x[3] = {X(1), X(2), X(3)}; Y y[3] = {Y(1), Y(2), Y(3)}; std::adjacent_difference(x, x+3, y); diff --git a/test/std/numerics/numeric.ops/adjacent.difference/adjacent_difference_op.pass.cpp b/test/std/numerics/numeric.ops/adjacent.difference/adjacent_difference_op.pass.cpp index fb0bbdc2836da..8a30a82212de1 100644 --- a/test/std/numerics/numeric.ops/adjacent.difference/adjacent_difference_op.pass.cpp +++ b/test/std/numerics/numeric.ops/adjacent.difference/adjacent_difference_op.pass.cpp @@ -23,6 +23,7 @@ #include <functional> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" template <class InIter, class OutIter> @@ -40,7 +41,7 @@ test() assert(ib[i] == ir[i]); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#if TEST_STD_VER >= 11 class Y; @@ -110,7 +111,7 @@ int main() test<const int*, random_access_iterator<int*> >(); test<const int*, int*>(); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#if TEST_STD_VER >= 11 X x[3] = {X(1), X(2), X(3)}; Y y[3] = {Y(1), Y(2), Y(3)}; std::adjacent_difference(x, x+3, y, std::minus<X>()); diff --git a/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp b/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp index af065b84d1bb1..961b515ef8d88 100644 --- a/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp +++ b/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: c++98, c++03, c++11, c++14 + // <numeric> // template<class _M, class _N> @@ -129,4 +130,11 @@ int main() assert((do_test<long, int>(non_cce))); assert((do_test<int, long long>(non_cce))); assert((do_test<long long, int>(non_cce))); + +// LWG#2837 + { + auto res = std::gcd((int64_t)1234, (int32_t)-2147483648); + static_assert( std::is_same<decltype(res), std::common_type<int64_t, int32_t>::type>::value, ""); + assert(res == 2); + } } 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 cd03d99ebf131..90d48398f54a7 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 @@ -128,4 +128,12 @@ int main() assert((do_test<long, int>(non_cce))); assert((do_test<int, long long>(non_cce))); assert((do_test<long long, int>(non_cce))); + +// LWG#2837 + { + auto res1 = std::lcm((int64_t)1234, (int32_t)-2147483648); + (void) std::lcm<int, unsigned long>(INT_MIN, 2); // this used to trigger UBSAN + static_assert( std::is_same<decltype(res1), std::common_type<int64_t, int32_t>::type>::value, ""); + assert(res1 == 1324997410816LL); + } } diff --git a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.cauchy/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.cauchy/eval.pass.cpp index d70d8f072c395..ca669dc4194a9 100644 --- a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.cauchy/eval.pass.cpp +++ b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.cauchy/eval.pass.cpp @@ -31,7 +31,6 @@ int main() { { typedef std::cauchy_distribution<> D; - typedef D::param_type P; typedef std::mt19937 G; G g; const double a = 10; @@ -47,7 +46,6 @@ int main() } { typedef std::cauchy_distribution<> D; - typedef D::param_type P; typedef std::mt19937 G; G g; const double a = -1.5; @@ -63,7 +61,6 @@ int main() } { typedef std::cauchy_distribution<> D; - typedef D::param_type P; typedef std::mt19937 G; G g; const double a = .5; diff --git a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/eval.pass.cpp index 3b54790aee0ae..3261880c6d04d 100644 --- a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/eval.pass.cpp +++ b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/eval.pass.cpp @@ -34,7 +34,6 @@ int main() { { typedef std::chi_squared_distribution<> D; - typedef D::param_type P; typedef std::minstd_rand G; G g; D d(0.5); @@ -74,7 +73,6 @@ int main() } { typedef std::chi_squared_distribution<> D; - typedef D::param_type P; typedef std::minstd_rand G; G g; D d(1); @@ -114,7 +112,6 @@ int main() } { typedef std::chi_squared_distribution<> D; - typedef D::param_type P; typedef std::mt19937 G; G g; D d(2); diff --git a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval.pass.cpp index 4da7f2e70e9b3..8025880d8754b 100644 --- a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval.pass.cpp +++ b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval.pass.cpp @@ -51,7 +51,6 @@ int main() // Purposefully only testing even integral values of m and n (for now) { typedef std::fisher_f_distribution<> D; - typedef D::param_type P; typedef std::mt19937 G; G g; D d(2, 4); @@ -69,7 +68,6 @@ int main() } { typedef std::fisher_f_distribution<> D; - typedef D::param_type P; typedef std::mt19937 G; G g; D d(4, 2); @@ -87,7 +85,6 @@ int main() } { typedef std::fisher_f_distribution<> D; - typedef D::param_type P; typedef std::mt19937 G; G g; D d(18, 20); diff --git a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.normal/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.normal/eval.pass.cpp index e1084d3ef03d2..2bf9204d3a091 100644 --- a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.normal/eval.pass.cpp +++ b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.normal/eval.pass.cpp @@ -34,7 +34,6 @@ int main() { { typedef std::normal_distribution<> D; - typedef D::param_type P; typedef std::minstd_rand G; G g; D d(5, 4); diff --git a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.exp/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.exp/eval.pass.cpp index 223d6f4d2216d..71aaa081b351f 100644 --- a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.exp/eval.pass.cpp +++ b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.exp/eval.pass.cpp @@ -34,7 +34,6 @@ int main() { { typedef std::exponential_distribution<> D; - typedef D::param_type P; typedef std::mt19937 G; G g; D d(.75); @@ -74,7 +73,6 @@ int main() } { typedef std::exponential_distribution<> D; - typedef D::param_type P; typedef std::mt19937 G; G g; D d(1); @@ -114,7 +112,6 @@ int main() } { typedef std::exponential_distribution<> D; - typedef D::param_type P; typedef std::mt19937 G; G g; D d(10); diff --git a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.weibull/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.weibull/eval.pass.cpp index 10337907b964e..ee0b68fb8f9c5 100644 --- a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.weibull/eval.pass.cpp +++ b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.weibull/eval.pass.cpp @@ -34,7 +34,6 @@ int main() { { typedef std::weibull_distribution<> D; - typedef D::param_type P; typedef std::mt19937 G; G g; D d(0.5, 2); @@ -78,7 +77,6 @@ int main() } { typedef std::weibull_distribution<> D; - typedef D::param_type P; typedef std::mt19937 G; G g; D d(1, .5); @@ -122,7 +120,6 @@ int main() } { typedef std::weibull_distribution<> D; - typedef D::param_type P; typedef std::mt19937 G; G g; D d(2, 3); |