summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/containers
diff options
context:
space:
mode:
authorLouis Dionne <ldionne@apple.com>2019-11-14 09:07:05 -0500
committerLouis Dionne <ldionne@apple.com>2019-11-14 09:07:05 -0500
commit1466335cf4b2854a0be1defcf279fe50772bad6f (patch)
tree60dbac938173ebae3019576622ed2ba19951a877 /libcxx/test/std/containers
parent8b77a3a0f4ef8c2cda3a0437fe54e2c2ecef1b17 (diff)
downloadbcm5719-llvm-1466335cf4b2854a0be1defcf279fe50772bad6f.tar.gz
bcm5719-llvm-1466335cf4b2854a0be1defcf279fe50772bad6f.zip
[libc++][P1872] span should have size_type, not index_type.
Thanks to Marek Kurdej for the patch. Differential Revision: https://reviews.llvm.org/D70206
Diffstat (limited to 'libcxx/test/std/containers')
-rw-r--r--libcxx/test/std/containers/views/span.cons/assign.pass.cpp4
-rw-r--r--libcxx/test/std/containers/views/span.cons/ptr_len.fail.cpp2
-rw-r--r--libcxx/test/std/containers/views/span.cons/ptr_len.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.iterators/rbegin.pass.cpp4
-rw-r--r--libcxx/test/std/containers/views/span.obs/size.pass.cpp2
-rw-r--r--libcxx/test/std/containers/views/span.obs/size_bytes.pass.cpp2
-rw-r--r--libcxx/test/std/containers/views/span.sub/first.pass.cpp2
-rw-r--r--libcxx/test/std/containers/views/span.sub/last.pass.cpp2
-rw-r--r--libcxx/test/std/containers/views/span.sub/subspan.pass.cpp2
-rw-r--r--libcxx/test/std/containers/views/types.pass.cpp6
11 files changed, 16 insertions, 16 deletions
diff --git a/libcxx/test/std/containers/views/span.cons/assign.pass.cpp b/libcxx/test/std/containers/views/span.cons/assign.pass.cpp
index d30869537de..cde1e168431 100644
--- a/libcxx/test/std/containers/views/span.cons/assign.pass.cpp
+++ b/libcxx/test/std/containers/views/span.cons/assign.pass.cpp
@@ -43,11 +43,11 @@ int main(int, char**)
// constexpr dynamically sized assignment
{
// On systems where 'ptrdiff_t' is a synonym for 'int',
-// the call span(ptr, 0) selects the (pointer, index_type) constructor.
+// the call span(ptr, 0) selects the (pointer, size_type) constructor.
// On systems where 'ptrdiff_t' is NOT a synonym for 'int',
// it is ambiguous, because of 0 also being convertible to a null pointer
// and so the compiler can't choose between:
-// span(pointer, index_type)
+// span(pointer, size_type)
// and span(pointer, pointer)
// We cast zero to std::ptrdiff_t to remove that ambiguity.
// Example:
diff --git a/libcxx/test/std/containers/views/span.cons/ptr_len.fail.cpp b/libcxx/test/std/containers/views/span.cons/ptr_len.fail.cpp
index d407ae77936..05dbcf8d1cd 100644
--- a/libcxx/test/std/containers/views/span.cons/ptr_len.fail.cpp
+++ b/libcxx/test/std/containers/views/span.cons/ptr_len.fail.cpp
@@ -10,7 +10,7 @@
// <span>
-// constexpr span(pointer ptr, index_type count);
+// constexpr span(pointer ptr, size_type count);
// Requires: [ptr, ptr + count) shall be a valid range.
// If extent is not equal to dynamic_extent, then count shall be equal to extent.
//
diff --git a/libcxx/test/std/containers/views/span.cons/ptr_len.pass.cpp b/libcxx/test/std/containers/views/span.cons/ptr_len.pass.cpp
index 2a4b260c87d..80908132fc6 100644
--- a/libcxx/test/std/containers/views/span.cons/ptr_len.pass.cpp
+++ b/libcxx/test/std/containers/views/span.cons/ptr_len.pass.cpp
@@ -10,7 +10,7 @@
// <span>
-// constexpr span(pointer ptr, index_type count);
+// constexpr span(pointer ptr, size_type count);
// Requires: [ptr, ptr + count) shall be a valid range.
// If extent is not equal to dynamic_extent, then count shall be equal to extent.
//
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 78278964f81..f67dc4473e0 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
@@ -10,8 +10,8 @@
// <span>
-// constexpr reference operator[](index_type idx) const;
-// constexpr reference operator()(index_type idx) const;
+// constexpr reference operator[](size_type idx) const;
+// constexpr reference operator()(size_type idx) const;
//
diff --git a/libcxx/test/std/containers/views/span.iterators/rbegin.pass.cpp b/libcxx/test/std/containers/views/span.iterators/rbegin.pass.cpp
index 797629a8652..7b8074fd560 100644
--- a/libcxx/test/std/containers/views/span.iterators/rbegin.pass.cpp
+++ b/libcxx/test/std/containers/views/span.iterators/rbegin.pass.cpp
@@ -31,7 +31,7 @@ constexpr bool testConstexprSpan(Span s)
}
else
{
- const typename Span::index_type last = s.size() - 1;
+ const typename Span::size_type last = s.size() - 1;
ret = ret && ( *b == s[last]);
ret = ret && ( &*b == &s[last]);
ret = ret && ( *cb == s[last]);
@@ -54,7 +54,7 @@ void testRuntimeSpan(Span s)
}
else
{
- const typename Span::index_type last = s.size() - 1;
+ const typename Span::size_type last = s.size() - 1;
assert( *b == s[last]);
assert( &*b == &s[last]);
assert( *cb == s[last]);
diff --git a/libcxx/test/std/containers/views/span.obs/size.pass.cpp b/libcxx/test/std/containers/views/span.obs/size.pass.cpp
index f26a2257115..ca29e2c7d9b 100644
--- a/libcxx/test/std/containers/views/span.obs/size.pass.cpp
+++ b/libcxx/test/std/containers/views/span.obs/size.pass.cpp
@@ -10,7 +10,7 @@
// <span>
-// constexpr index_type size() const noexcept;
+// constexpr size_type size() const noexcept;
//
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 257956684ea..1cd3b69431c 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
@@ -10,7 +10,7 @@
// <span>
-// constexpr index_type size_bytes() const noexcept;
+// constexpr size_type size_bytes() const noexcept;
//
// Effects: Equivalent to: return size() * sizeof(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 30ab130381c..f2e77b597b2 100644
--- a/libcxx/test/std/containers/views/span.sub/first.pass.cpp
+++ b/libcxx/test/std/containers/views/span.sub/first.pass.cpp
@@ -13,7 +13,7 @@
// template<size_t Count>
// constexpr span<element_type, Count> first() const;
//
-// constexpr span<element_type, dynamic_extent> first(index_type count) const;
+// constexpr span<element_type, dynamic_extent> first(size_type count) const;
//
// Requires: 0 <= Count && Count <= size().
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 2864a7f65e5..6e0fb3c1d60 100644
--- a/libcxx/test/std/containers/views/span.sub/last.pass.cpp
+++ b/libcxx/test/std/containers/views/span.sub/last.pass.cpp
@@ -13,7 +13,7 @@
// template<size_t Count>
// constexpr span<element_type, Count> last() const;
//
-// constexpr span<element_type, dynamic_extent> last(index_type count) const;
+// constexpr span<element_type, dynamic_extent> last(size_type count) const;
//
// Requires: 0 <= Count && Count <= size().
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 f2dbe8408dd..caa7b564df3 100644
--- a/libcxx/test/std/containers/views/span.sub/subspan.pass.cpp
+++ b/libcxx/test/std/containers/views/span.sub/subspan.pass.cpp
@@ -14,7 +14,7 @@
// constexpr span<element_type, see below> subspan() const;
//
// constexpr span<element_type, dynamic_extent> subspan(
-// index_type offset, index_type count = dynamic_extent) const;
+// size_type offset, size_type count = dynamic_extent) const;
//
// Requires: (0 <= Offset && Offset <= size())
// && (Count == dynamic_extent || Count >= 0 && Offset + Count <= size())
diff --git a/libcxx/test/std/containers/views/types.pass.cpp b/libcxx/test/std/containers/views/types.pass.cpp
index 787cfdd4e0c..51507678c82 100644
--- a/libcxx/test/std/containers/views/types.pass.cpp
+++ b/libcxx/test/std/containers/views/types.pass.cpp
@@ -16,7 +16,7 @@
// // constants and types
// using element_type = ElementType;
// using value_type = remove_cv_t<ElementType>;
-// using index_type = size_t;
+// using size_type = size_t;
// using difference_type = ptrdiff_t;
// using pointer = element_type *;
// using reference = element_type &;
@@ -27,7 +27,7 @@
// using reverse_iterator = std::reverse_iterator<iterator>;
// using const_reverse_iterator = std::reverse_iterator<const_iterator>;
//
-// static constexpr index_type extent = Extent;
+// static constexpr size_type extent = Extent;
//
#include <span>
@@ -68,7 +68,7 @@ void testSpan()
{
ASSERT_SAME_TYPE(typename S::element_type, ElementType);
ASSERT_SAME_TYPE(typename S::value_type, std::remove_cv_t<ElementType>);
- ASSERT_SAME_TYPE(typename S::index_type, std::size_t);
+ ASSERT_SAME_TYPE(typename S::size_type, std::size_t);
ASSERT_SAME_TYPE(typename S::difference_type, std::ptrdiff_t);
ASSERT_SAME_TYPE(typename S::pointer, ElementType *);
ASSERT_SAME_TYPE(typename S::const_pointer, const ElementType *);
OpenPOWER on IntegriCloud