From 24597f254dc229da1aa50258b7f444a0e479460f Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Mon, 6 Feb 2017 16:03:23 +0000 Subject: [PATCH] Add some tests to verify that we implement LWG#2837 correctly. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294194 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp | 7 +++++++ test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp | 7 +++++++ www/upcoming_meeting.html | 4 ++-- 3 files changed, 16 insertions(+), 2 deletions(-) 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 af065b84d..ddb14cd34 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 @@ -129,4 +129,11 @@ int main() assert((do_test(non_cce))); assert((do_test(non_cce))); assert((do_test(non_cce))); + +// LWG#2837 + { + auto res = std::gcd((int64_t)1234, (int32_t)-2147483648); + static_assert( std::is_same::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 cd03d99eb..799a7ebfa 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,11 @@ int main() assert((do_test(non_cce))); assert((do_test(non_cce))); assert((do_test(non_cce))); + +// LWG#2837 + { + auto res = std::lcm((int64_t)1234, (int32_t)-2147483648); + static_assert( std::is_same::type>::value, ""); + assert(res == -1324997410816LL); + } } diff --git a/www/upcoming_meeting.html b/www/upcoming_meeting.html index e85fbcdcb..d35fdcaed 100644 --- a/www/upcoming_meeting.html +++ b/www/upcoming_meeting.html @@ -77,7 +77,7 @@ 2826string_view iterators use old wordingKonaNothing to do 2834Resolution LWG 2223 is missing wording about end iteratorsKonaNothing to do 2835LWG 2536 seems to misspecify <tgmath.h>Kona - 2837gcd and lcm should support a wider range of input valuesKona + 2837gcd and lcm should support a wider range of input valuesKonaWe do this already 2838is_literal_type specification needs a little cleanupKonaNothing to do 2842in_place_t check for optional::optional(U&&) should decay UKona 2850std::function move constructor does unnecessary workKona @@ -111,7 +111,7 @@
  • 2826 - Nothing to do; just moving words around
  • 2834 - Nothing to do; just moving words around
  • 2835 - I'm pretty sure we already do this.
  • -
  • 2837 - Doesn't look too hard.
  • +
  • 2837 - Added some tests to ensure we do this already.
  • 2838 - Nothing to do; just moving words around
  • 2842 - This should be easy; trick will be devising tests.
  • 2850 - I think we already do this.