[libcxx] r187552 - Constrain fill_n -> memset operations to include implicit convertibility to unsigned char. This fixes http://llvm.org/bugs/show_bug.cgi?id=16764. Also a drive-by fix on a chrono test suite bug.

David Blaikie dblaikie at gmail.com
Thu Aug 1 00:03:27 PDT 2013


On Wed, Jul 31, 2013 at 5:41 PM, Howard Hinnant <hhinnant at apple.com> wrote:
> Author: hhinnant
> Date: Wed Jul 31 19:41:55 2013
> New Revision: 187552
>
> URL: http://llvm.org/viewvc/llvm-project?rev=187552&view=rev
> Log:
> Constrain fill_n -> memset operations to include implicit convertibility to unsigned char.  This fixes http://llvm.org/bugs/show_bug.cgi?id=16764.  Also a drive-by fix on a chrono test suite bug.
>
> Modified:
>     libcxx/trunk/include/algorithm
>     libcxx/trunk/test/utilities/time/time.duration/time.duration.cons/default.pass.cpp
>
> Modified: libcxx/trunk/include/algorithm
> URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/algorithm?rev=187552&r1=187551&r2=187552&view=diff
> ==============================================================================
> --- libcxx/trunk/include/algorithm (original)
> +++ libcxx/trunk/include/algorithm Wed Jul 31 19:41:55 2013
> @@ -2012,6 +2012,7 @@ fill_n(_OutputIterator __first, _Size __
>     return _VSTD::__fill_n(__first, __n, __value_, integral_constant<bool,
>                                                is_pointer<_OutputIterator>::value &&
>                                                is_trivially_assignable<typename remove_pointer<_OutputIterator>::type, _Tp>::value &&
> +                                              is_convertible<_Tp, unsigned char>::value &&

Test case for this?

>                                                sizeof(typename remove_pointer<_OutputIterator>::type) == 1>());
>  }
>
>
> Modified: libcxx/trunk/test/utilities/time/time.duration/time.duration.cons/default.pass.cpp
> URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/time/time.duration/time.duration.cons/default.pass.cpp?rev=187552&r1=187551&r2=187552&view=diff
> ==============================================================================
> --- libcxx/trunk/test/utilities/time/time.duration/time.duration.cons/default.pass.cpp (original)
> +++ libcxx/trunk/test/utilities/time/time.duration/time.duration.cons/default.pass.cpp Wed Jul 31 19:41:55 2013
> @@ -27,7 +27,7 @@ test()
>      D d;
>      assert(d.count() == typename D::rep());
>  #ifndef _LIBCPP_HAS_NO_CONSTEXPR
> -    constexpr D d2;
> +    constexpr D d2 = D();
>      static_assert(d2.count() == typename D::rep(), "");
>  #endif
>  }
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list