[libcxx] r176559 - 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.

Richard Smith richard at metafoo.co.uk
Wed Mar 6 10:14:05 PST 2013


On 6 Mar 2013 09:32, "Howard Hinnant" <hhinnant at apple.com> wrote:
>
> Author: hhinnant
> Date: Wed Mar  6 11:30:26 2013
> New Revision: 176559
>
> URL: http://llvm.org/viewvc/llvm-project?rev=176559&view=rev
> Log:
> 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.
>
> Modified:
>     libcxx/trunk/include/bitset
>
> Modified: libcxx/trunk/include/bitset
> URL:
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/bitset?rev=176559&r1=176558&r2=176559&view=diff
>
==============================================================================
> --- libcxx/trunk/include/bitset (original)
> +++ libcxx/trunk/include/bitset Wed Mar  6 11:30:26 2013
> @@ -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

#else?

> +#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;
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130306/b5e1dfb3/attachment.html>


More information about the cfe-commits mailing list