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.

llvm-svn: 187552
This commit is contained in:
Howard Hinnant 2013-08-01 00:41:55 +00:00
parent 03cd107364
commit ce075cf1aa
2 changed files with 2 additions and 1 deletions

View File

@ -2012,6 +2012,7 @@ fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_)
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>());
}

View File

@ -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
}