summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2013-03-06 17:30:26 +0000
committerHoward Hinnant <hhinnant@apple.com>2013-03-06 17:30:26 +0000
commit53b9ee061f129064001eae2097a49b53bab22914 (patch)
tree5e674c17a2f17f7164ff1444ed3cbd3ec99f78d5
parent7de484640e3ea29f97890a3690c00f2d57a76425 (diff)
downloadbcm5719-llvm-53b9ee061f129064001eae2097a49b53bab22914.tar.gz
bcm5719-llvm-53b9ee061f129064001eae2097a49b53bab22914.zip
The bitset(unsigned long long) constructor was broken by the constexpr additions only on 32 bit platforms. Fixed. This addresses http://llvm.org/bugs/show_bug.cgi?id=15444.
llvm-svn: 176559
-rw-r--r--libcxx/include/bitset7
1 files changed, 7 insertions, 0 deletions
diff --git a/libcxx/include/bitset b/libcxx/include/bitset
index 1167f50440f..06fd729ef8c 100644
--- a/libcxx/include/bitset
+++ b/libcxx/include/bitset
@@ -249,7 +249,13 @@ inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR
__bitset<_N_words, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
#ifndef _LIBCPP_HAS_NO_CONSTEXPR
+#if __SIZE_WIDTH__ == 64
: __first_{__v}
+#elif __SIZE_WIDTH__ == 32
+ : __first_{__v, __v >> __bits_per_word}
+#elif
+#error This constructor has not been ported to this platform
+#endif
#endif
{
#ifdef _LIBCPP_HAS_NO_CONSTEXPR
@@ -633,6 +639,7 @@ template <size_t _Size>
class _LIBCPP_VISIBLE bitset
: private __bitset<_Size == 0 ? 0 : (_Size - 1) / (sizeof(size_t) * CHAR_BIT) + 1, _Size>
{
+public:
static const unsigned __n_words = _Size == 0 ? 0 : (_Size - 1) / (sizeof(size_t) * CHAR_BIT) + 1;
typedef __bitset<__n_words, _Size> base;
OpenPOWER on IntegriCloud