forked from OSchip/llvm-project
Fix occurrences of _LIBCPP_ASSERT in span tests
llvm-svn: 357092
This commit is contained in:
parent
4d47ac3b30
commit
132955fa66
|
@ -26,7 +26,7 @@
|
|||
template <typename Span>
|
||||
constexpr bool testConstexprSpan(Span sp)
|
||||
{
|
||||
_LIBCPP_ASSERT(sp.back(), "");
|
||||
LIBCPP_ASSERT(noexcept(sp.back()));
|
||||
return std::addressof(sp.back()) == sp.data() + sp.size() - 1;
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ constexpr bool testConstexprSpan(Span sp)
|
|||
template <typename Span>
|
||||
void testRuntimeSpan(Span sp)
|
||||
{
|
||||
_LIBCPP_ASSERT(sp.back(), "");
|
||||
LIBCPP_ASSERT(noexcept(sp.back()));
|
||||
assert(std::addressof(sp.back()) == sp.data() + sp.size() - 1);
|
||||
}
|
||||
|
||||
|
@ -71,5 +71,5 @@ int main(int, char**)
|
|||
testRuntimeSpan(std::span<std::string> (&s, 1));
|
||||
testRuntimeSpan(std::span<std::string, 1>(&s, 1));
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
template <typename Span>
|
||||
constexpr bool testConstexprSpan(Span sp)
|
||||
{
|
||||
_LIBCPP_ASSERT(sp.front(), "");
|
||||
LIBCPP_ASSERT(noexcept(sp.front()));
|
||||
return std::addressof(sp.front()) == sp.data();
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ constexpr bool testConstexprSpan(Span sp)
|
|||
template <typename Span>
|
||||
void testRuntimeSpan(Span sp)
|
||||
{
|
||||
_LIBCPP_ASSERT(sp.front(), "");
|
||||
LIBCPP_ASSERT(noexcept(sp.front()));
|
||||
assert(std::addressof(sp.front()) == sp.data());
|
||||
}
|
||||
|
||||
|
@ -71,5 +71,5 @@ int main(int, char**)
|
|||
testRuntimeSpan(std::span<std::string> (&s, 1));
|
||||
testRuntimeSpan(std::span<std::string, 1>(&s, 1));
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
template <typename Span>
|
||||
constexpr bool testConstexprSpan(Span sp, size_t idx)
|
||||
{
|
||||
_LIBCPP_ASSERT(noexcept(sp[idx]), "");
|
||||
LIBCPP_ASSERT(noexcept(sp[idx]));
|
||||
|
||||
typename Span::reference r1 = sp[idx];
|
||||
typename Span::reference r2 = *(sp.data() + idx);
|
||||
|
@ -36,7 +36,7 @@ constexpr bool testConstexprSpan(Span sp, size_t idx)
|
|||
template <typename Span>
|
||||
void testRuntimeSpan(Span sp, size_t idx)
|
||||
{
|
||||
_LIBCPP_ASSERT(noexcept(sp[idx]), "");
|
||||
LIBCPP_ASSERT(noexcept(sp[idx]));
|
||||
|
||||
typename Span::reference r1 = sp[idx];
|
||||
typename Span::reference r2 = *(sp.data() + idx);
|
||||
|
|
Loading…
Reference in New Issue