summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp')
-rw-r--r--libcxx/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/libcxx/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp b/libcxx/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp
index af065b84d1b..ddb14cd3405 100644
--- a/libcxx/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp
+++ b/libcxx/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp
@@ -129,4 +129,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);
+ }
}
OpenPOWER on IntegriCloud