From 9d00ed5d8749f472e63ca7e5a510da2ee58f9dbd Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Fri, 29 Mar 2013 21:22:22 +0000 Subject: [PATCH] Test case was forming the wrong limits when size_t != unsigned long. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@178370 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../utilities/template.bitset/bitset.members/to_ulong.pass.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/utilities/template.bitset/bitset.members/to_ulong.pass.cpp b/test/utilities/template.bitset/bitset.members/to_ulong.pass.cpp index fa62c97a5..3ad1abade 100644 --- a/test/utilities/template.bitset/bitset.members/to_ulong.pass.cpp +++ b/test/utilities/template.bitset/bitset.members/to_ulong.pass.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -19,7 +20,7 @@ void test_to_ulong() { const std::size_t M = sizeof(unsigned long) * CHAR_BIT < N ? sizeof(unsigned long) * CHAR_BIT : N; const std::size_t X = M == 0 ? sizeof(unsigned long) * CHAR_BIT - 1 : sizeof(unsigned long) * CHAR_BIT - M; - const std::size_t max = M == 0 ? 0 : std::size_t(-1) >> X; + const std::size_t max = M == 0 ? 0 : std::size_t(std::numeric_limits::max()) >> X; std::size_t tests[] = {0, std::min(1, max), std::min(2, max),