[libcxx] r332797 - Remove expression '1L + INT_MAX', because it overflows on machines where int/long are the same size
Marshall Clow via cfe-commits
cfe-commits at lists.llvm.org
Fri May 18 20:09:05 PDT 2018
Author: marshall
Date: Fri May 18 20:09:05 2018
New Revision: 332797
URL: http://llvm.org/viewvc/llvm-project?rev=332797&view=rev
Log:
Remove expression '1L + INT_MAX', because it overflows on machines where int/long are the same size
Modified:
libcxx/trunk/test/std/containers/sequences/deque/deque.cons/deduct.pass.cpp
Modified: libcxx/trunk/test/std/containers/sequences/deque/deque.cons/deduct.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/deque/deque.cons/deduct.pass.cpp?rev=332797&r1=332796&r2=332797&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/deque/deque.cons/deduct.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/deque/deque.cons/deduct.pass.cpp Fri May 18 20:09:05 2018
@@ -43,12 +43,12 @@ int main()
}
{
- const long arr[] = {INT_MAX, 1L + INT_MAX, 2L, 3L };
+ const long arr[] = {INT_MAX, 1L, 2L, 3L };
std::deque deq(std::begin(arr), std::end(arr), std::allocator<long>());
static_assert(std::is_same_v<decltype(deq)::value_type, long>, "");
assert(deq.size() == 4);
assert(deq[0] == INT_MAX);
- assert(deq[1] == 1L + INT_MAX);
+ assert(deq[1] == 1L);
assert(deq[2] == 2L);
}
More information about the cfe-commits
mailing list