diff options
author | Howard Hinnant <hhinnant@apple.com> | 2013-03-29 21:22:22 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2013-03-29 21:22:22 +0000 |
commit | cf1dc8d39e2c9870468ca86f7956a65c7745fece (patch) | |
tree | 842ba48177336b48a8a1332a04caa07fed8c39e9 /libcxx/test | |
parent | 3b8f8778607d0438acc9bc2c87a5870cdc142da6 (diff) | |
download | bcm5719-llvm-cf1dc8d39e2c9870468ca86f7956a65c7745fece.tar.gz bcm5719-llvm-cf1dc8d39e2c9870468ca86f7956a65c7745fece.zip |
Test case was forming the wrong limits when size_t != unsigned long.
llvm-svn: 178370
Diffstat (limited to 'libcxx/test')
-rw-r--r-- | libcxx/test/utilities/template.bitset/bitset.members/to_ulong.pass.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libcxx/test/utilities/template.bitset/bitset.members/to_ulong.pass.cpp b/libcxx/test/utilities/template.bitset/bitset.members/to_ulong.pass.cpp index fa62c97a5cb..3ad1abade9f 100644 --- a/libcxx/test/utilities/template.bitset/bitset.members/to_ulong.pass.cpp +++ b/libcxx/test/utilities/template.bitset/bitset.members/to_ulong.pass.cpp @@ -11,6 +11,7 @@ #include <bitset> #include <algorithm> +#include <limits> #include <climits> #include <cassert> @@ -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<unsigned long>::max()) >> X; std::size_t tests[] = {0, std::min<std::size_t>(1, max), std::min<std::size_t>(2, max), |