From 0d1965d8c2d9bf99e18b516b9e7fdcdaca9c4746 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Mon, 28 Jul 2014 15:02:42 +0000 Subject: [PATCH] Fix PR#20471. Add a cast in __align_it to ensure that the bit twiddling is done at the correct size. A better solution, IMHO, would be to declare vector::__bits_per_word as 'size_type', rather than 'unsigned', but that's a possible ABI change. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214088 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/vector | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/vector b/include/vector index 1e638b9a4..5d41bd110 100644 --- a/include/vector +++ b/include/vector @@ -2352,7 +2352,7 @@ private: void deallocate() _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY static size_type __align_it(size_type __new_size) _NOEXCEPT - {return __new_size + (__bits_per_word-1) & ~(__bits_per_word-1);}; + {return __new_size + (__bits_per_word-1) & ~((size_type)__bits_per_word-1);}; _LIBCPP_INLINE_VISIBILITY size_type __recommend(size_type __new_size) const; _LIBCPP_INLINE_VISIBILITY void __construct_at_end(size_type __n, bool __x); template