[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.
Howard Hinnant
hhinnant at apple.com
Wed Jul 31 17:41:56 PDT 2013
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 &&
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
}
More information about the cfe-commits
mailing list