summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/containers
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2019-03-06 03:59:44 +0000
committerMarshall Clow <mclow.lists@gmail.com>2019-03-06 03:59:44 +0000
commit8eda3ad29d89317aa25cf2e7aaf8c785b32fc608 (patch)
tree0e7a72a662e62ff3259f96d65885e6065c036064 /libcxx/test/std/containers
parentc2d6b84d3c7ec999ee2df9c3a061bd63c147f977 (diff)
downloadbcm5719-llvm-8eda3ad29d89317aa25cf2e7aaf8c785b32fc608.tar.gz
bcm5719-llvm-8eda3ad29d89317aa25cf2e7aaf8c785b32fc608.zip
Eradicate all the ptrdiff_ts in span left over from applying P1227. A couple of other minor cleanups. NFC
llvm-svn: 355481
Diffstat (limited to 'libcxx/test/std/containers')
-rw-r--r--libcxx/test/std/containers/views/span.cons/span.fail.cpp2
-rw-r--r--libcxx/test/std/containers/views/span.cons/span.pass.cpp2
-rw-r--r--libcxx/test/std/containers/views/span.elem/op_idx.pass.cpp4
-rw-r--r--libcxx/test/std/containers/views/span.objectrep/as_bytes.pass.cpp6
-rw-r--r--libcxx/test/std/containers/views/span.objectrep/as_writeable_bytes.fail.cpp4
-rw-r--r--libcxx/test/std/containers/views/span.objectrep/as_writeable_bytes.pass.cpp6
-rw-r--r--libcxx/test/std/containers/views/span.obs/size_bytes.pass.cpp4
-rw-r--r--libcxx/test/std/containers/views/span.sub/first.pass.cpp6
-rw-r--r--libcxx/test/std/containers/views/span.sub/last.pass.cpp6
-rw-r--r--libcxx/test/std/containers/views/span.sub/subspan.pass.cpp10
-rw-r--r--libcxx/test/std/containers/views/types.pass.cpp2
11 files changed, 26 insertions, 26 deletions
diff --git a/libcxx/test/std/containers/views/span.cons/span.fail.cpp b/libcxx/test/std/containers/views/span.cons/span.fail.cpp
index f559b1fb0c2..c303719fd01 100644
--- a/libcxx/test/std/containers/views/span.cons/span.fail.cpp
+++ b/libcxx/test/std/containers/views/span.cons/span.fail.cpp
@@ -10,7 +10,7 @@
// <span>
-// template<class OtherElementType, ptrdiff_t OtherExtent>
+// template<class OtherElementType, size_t OtherExtent>
// constexpr span(const span<OtherElementType, OtherExtent>& s) noexcept;
//
// Remarks: This constructor shall not participate in overload resolution unless:
diff --git a/libcxx/test/std/containers/views/span.cons/span.pass.cpp b/libcxx/test/std/containers/views/span.cons/span.pass.cpp
index 74da3fce894..62f8b9da11b 100644
--- a/libcxx/test/std/containers/views/span.cons/span.pass.cpp
+++ b/libcxx/test/std/containers/views/span.cons/span.pass.cpp
@@ -10,7 +10,7 @@
// <span>
-// template<class OtherElementType, ptrdiff_t OtherExtent>
+// template<class OtherElementType, size_t OtherExtent>
// constexpr span(const span<OtherElementType, OtherExtent>& s) noexcept;
//
// Remarks: This constructor shall not participate in overload resolution unless:
diff --git a/libcxx/test/std/containers/views/span.elem/op_idx.pass.cpp b/libcxx/test/std/containers/views/span.elem/op_idx.pass.cpp
index cb63ec9d17b..893331ad8f1 100644
--- a/libcxx/test/std/containers/views/span.elem/op_idx.pass.cpp
+++ b/libcxx/test/std/containers/views/span.elem/op_idx.pass.cpp
@@ -23,7 +23,7 @@
template <typename Span>
-constexpr bool testConstexprSpan(Span sp, ptrdiff_t idx)
+constexpr bool testConstexprSpan(Span sp, size_t idx)
{
_LIBCPP_ASSERT(noexcept(sp[idx]), "");
@@ -34,7 +34,7 @@ constexpr bool testConstexprSpan(Span sp, ptrdiff_t idx)
template <typename Span>
-void testRuntimeSpan(Span sp, ptrdiff_t idx)
+void testRuntimeSpan(Span sp, size_t idx)
{
_LIBCPP_ASSERT(noexcept(sp[idx]), "");
diff --git a/libcxx/test/std/containers/views/span.objectrep/as_bytes.pass.cpp b/libcxx/test/std/containers/views/span.objectrep/as_bytes.pass.cpp
index 12772c42f16..ff1038e0b11 100644
--- a/libcxx/test/std/containers/views/span.objectrep/as_bytes.pass.cpp
+++ b/libcxx/test/std/containers/views/span.objectrep/as_bytes.pass.cpp
@@ -10,11 +10,11 @@
// <span>
-// template <class ElementType, ptrdiff_t Extent>
+// template <class ElementType, size_t Extent>
// span<const byte,
// Extent == dynamic_extent
// ? dynamic_extent
-// : static_cast<ptrdiff_t>(sizeof(ElementType)) * Extent>
+// : sizeof(ElementType) * Extent>
// as_bytes(span<ElementType, Extent> s) noexcept;
@@ -36,7 +36,7 @@ void testRuntimeSpan(Span sp)
if (sp.extent == std::dynamic_extent)
assert(spBytes.extent == std::dynamic_extent);
else
- assert(spBytes.extent == static_cast<std::ptrdiff_t>(sizeof(typename Span::element_type)) * sp.extent);
+ assert(spBytes.extent == sizeof(typename Span::element_type) * sp.extent);
assert((void *) spBytes.data() == (void *) sp.data());
assert(spBytes.size() == sp.size_bytes());
diff --git a/libcxx/test/std/containers/views/span.objectrep/as_writeable_bytes.fail.cpp b/libcxx/test/std/containers/views/span.objectrep/as_writeable_bytes.fail.cpp
index 9dadedd7523..388da084ae0 100644
--- a/libcxx/test/std/containers/views/span.objectrep/as_writeable_bytes.fail.cpp
+++ b/libcxx/test/std/containers/views/span.objectrep/as_writeable_bytes.fail.cpp
@@ -10,11 +10,11 @@
// <span>
-// template <class ElementType, ptrdiff_t Extent>
+// template <class ElementType, size_t Extent>
// span<byte,
// Extent == dynamic_extent
// ? dynamic_extent
-// : static_cast<ptrdiff_t>(sizeof(ElementType)) * Extent>
+// : sizeof(ElementType) * Extent>
// as_writeable_bytes(span<ElementType, Extent> s) noexcept;
diff --git a/libcxx/test/std/containers/views/span.objectrep/as_writeable_bytes.pass.cpp b/libcxx/test/std/containers/views/span.objectrep/as_writeable_bytes.pass.cpp
index b12500d4ffb..409f6fa7cd6 100644
--- a/libcxx/test/std/containers/views/span.objectrep/as_writeable_bytes.pass.cpp
+++ b/libcxx/test/std/containers/views/span.objectrep/as_writeable_bytes.pass.cpp
@@ -10,11 +10,11 @@
// <span>
-// template <class ElementType, ptrdiff_t Extent>
+// template <class ElementType, size_t Extent>
// span<byte,
// Extent == dynamic_extent
// ? dynamic_extent
-// : static_cast<ptrdiff_t>(sizeof(ElementType)) * Extent>
+// : sizeof(ElementType) * Extent>
// as_writeable_bytes(span<ElementType, Extent> s) noexcept;
@@ -36,7 +36,7 @@ void testRuntimeSpan(Span sp)
if (sp.extent == std::dynamic_extent)
assert(spBytes.extent == std::dynamic_extent);
else
- assert(spBytes.extent == static_cast<std::ptrdiff_t>(sizeof(typename Span::element_type)) * sp.extent);
+ assert(spBytes.extent == sizeof(typename Span::element_type) * sp.extent);
assert(static_cast<void*>(spBytes.data()) == static_cast<void*>(sp.data()));
assert(spBytes.size() == sp.size_bytes());
diff --git a/libcxx/test/std/containers/views/span.obs/size_bytes.pass.cpp b/libcxx/test/std/containers/views/span.obs/size_bytes.pass.cpp
index 447829d516e..257956684ea 100644
--- a/libcxx/test/std/containers/views/span.obs/size_bytes.pass.cpp
+++ b/libcxx/test/std/containers/views/span.obs/size_bytes.pass.cpp
@@ -23,7 +23,7 @@
template <typename Span>
-constexpr bool testConstexprSpan(Span sp, ptrdiff_t sz)
+constexpr bool testConstexprSpan(Span sp, size_t sz)
{
ASSERT_NOEXCEPT(sp.size_bytes());
return (size_t) sp.size_bytes() == sz * sizeof(typename Span::element_type);
@@ -31,7 +31,7 @@ constexpr bool testConstexprSpan(Span sp, ptrdiff_t sz)
template <typename Span>
-void testRuntimeSpan(Span sp, ptrdiff_t sz)
+void testRuntimeSpan(Span sp, size_t sz)
{
ASSERT_NOEXCEPT(sp.size_bytes());
assert((size_t) sp.size_bytes() == sz * sizeof(typename Span::element_type));
diff --git a/libcxx/test/std/containers/views/span.sub/first.pass.cpp b/libcxx/test/std/containers/views/span.sub/first.pass.cpp
index f9da9fdc233..30ab130381c 100644
--- a/libcxx/test/std/containers/views/span.sub/first.pass.cpp
+++ b/libcxx/test/std/containers/views/span.sub/first.pass.cpp
@@ -10,7 +10,7 @@
// <span>
-// template<ptrdiff_t Count>
+// template<size_t Count>
// constexpr span<element_type, Count> first() const;
//
// constexpr span<element_type, dynamic_extent> first(index_type count) const;
@@ -25,7 +25,7 @@
#include "test_macros.h"
-template <typename Span, ptrdiff_t Count>
+template <typename Span, size_t Count>
constexpr bool testConstexprSpan(Span sp)
{
LIBCPP_ASSERT((noexcept(sp.template first<Count>())));
@@ -45,7 +45,7 @@ constexpr bool testConstexprSpan(Span sp)
}
-template <typename Span, ptrdiff_t Count>
+template <typename Span, size_t Count>
void testRuntimeSpan(Span sp)
{
LIBCPP_ASSERT((noexcept(sp.template first<Count>())));
diff --git a/libcxx/test/std/containers/views/span.sub/last.pass.cpp b/libcxx/test/std/containers/views/span.sub/last.pass.cpp
index e0a399ff9cd..2864a7f65e5 100644
--- a/libcxx/test/std/containers/views/span.sub/last.pass.cpp
+++ b/libcxx/test/std/containers/views/span.sub/last.pass.cpp
@@ -10,7 +10,7 @@
// <span>
-// template<ptrdiff_t Count>
+// template<size_t Count>
// constexpr span<element_type, Count> last() const;
//
// constexpr span<element_type, dynamic_extent> last(index_type count) const;
@@ -25,7 +25,7 @@
#include "test_macros.h"
-template <typename Span, ptrdiff_t Count>
+template <typename Span, size_t Count>
constexpr bool testConstexprSpan(Span sp)
{
LIBCPP_ASSERT((noexcept(sp.template last<Count>())));
@@ -45,7 +45,7 @@ constexpr bool testConstexprSpan(Span sp)
}
-template <typename Span, ptrdiff_t Count>
+template <typename Span, size_t Count>
void testRuntimeSpan(Span sp)
{
LIBCPP_ASSERT((noexcept(sp.template last<Count>())));
diff --git a/libcxx/test/std/containers/views/span.sub/subspan.pass.cpp b/libcxx/test/std/containers/views/span.sub/subspan.pass.cpp
index 9cb73109347..f2dbe8408dd 100644
--- a/libcxx/test/std/containers/views/span.sub/subspan.pass.cpp
+++ b/libcxx/test/std/containers/views/span.sub/subspan.pass.cpp
@@ -10,7 +10,7 @@
// <span>
-// template<ptrdiff_t Offset, ptrdiff_t Count = dynamic_extent>
+// template<size_t Offset, size_t Count = dynamic_extent>
// constexpr span<element_type, see below> subspan() const;
//
// constexpr span<element_type, dynamic_extent> subspan(
@@ -26,7 +26,7 @@
#include "test_macros.h"
-template <typename Span, ptrdiff_t Offset, ptrdiff_t Count>
+template <typename Span, size_t Offset, size_t Count>
constexpr bool testConstexprSpan(Span sp)
{
LIBCPP_ASSERT((noexcept(sp.template subspan<Offset, Count>())));
@@ -45,7 +45,7 @@ constexpr bool testConstexprSpan(Span sp)
&& std::equal(s1.begin(), s1.end(), sp.begin() + Offset);
}
-template <typename Span, ptrdiff_t Offset>
+template <typename Span, size_t Offset>
constexpr bool testConstexprSpan(Span sp)
{
LIBCPP_ASSERT((noexcept(sp.template subspan<Offset>())));
@@ -65,7 +65,7 @@ constexpr bool testConstexprSpan(Span sp)
}
-template <typename Span, ptrdiff_t Offset, ptrdiff_t Count>
+template <typename Span, size_t Offset, size_t Count>
void testRuntimeSpan(Span sp)
{
LIBCPP_ASSERT((noexcept(sp.template subspan<Offset, Count>())));
@@ -84,7 +84,7 @@ void testRuntimeSpan(Span sp)
}
-template <typename Span, ptrdiff_t Offset>
+template <typename Span, size_t Offset>
void testRuntimeSpan(Span sp)
{
LIBCPP_ASSERT((noexcept(sp.template subspan<Offset>())));
diff --git a/libcxx/test/std/containers/views/types.pass.cpp b/libcxx/test/std/containers/views/types.pass.cpp
index 60c365b8938..787cfdd4e0c 100644
--- a/libcxx/test/std/containers/views/types.pass.cpp
+++ b/libcxx/test/std/containers/views/types.pass.cpp
@@ -10,7 +10,7 @@
// <span>
-// template<class ElementType, ptrdiff_t Extent = dynamic_extent>
+// template<class ElementType, size_t Extent = dynamic_extent>
// class span {
// public:
// // constants and types
OpenPOWER on IntegriCloud