summaryrefslogtreecommitdiff
path: root/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp')
-rw-r--r--test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp8
1 files changed, 8 insertions, 0 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 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);
+ }
}