diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:03:23 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:03:23 +0000 |
commit | 0dc0969cd0a732760f0aa79942a04e0eaef297c4 (patch) | |
tree | 051bdb57b1ac6ee143f61ddbb47bd0da619f6f0c /test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp | |
parent | 868847c6900e575417c03bced6e562b3af891318 (diff) |
Notes
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.cpp | 8 |
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); + } } |