[libcxx-commits] [libcxx] [libc++][span][test] Various cleanups for <span> tests (PR #202319)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jun 8 07:00:38 PDT 2026


================
@@ -5,32 +5,30 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03, c++11, c++14, c++17
+
+// REQUIRES: std-at-least-c++20
 
 // <span>
 
 // template<class ElementType, size_t Extent = dynamic_extent>
 // class span {
 // public:
-//  // constants and types
-//  using element_type           = ElementType;
-//  using value_type             = remove_cv_t<ElementType>;
-//  using size_type              = size_t;
-//  using difference_type        = ptrdiff_t;
-//  using pointer                = element_type *;
-//  using reference              = element_type &;
-//  using const_pointer          = const element_type *;
-//  using const_reference        = const element_type &;
-//  using iterator               = implementation-defined;
-//  using const_iterator         = implementation-defined;
-//  using reverse_iterator       = std::reverse_iterator<iterator>;
-//  using const_reverse_iterator = std::reverse_iterator<const_iterator>;
-//
-//  static constexpr size_type extent = Extent;
-//
+//   // constants and types
+//   using element_type = ElementType;
+//   using value_type = remove_cv_t<ElementType>;
+//   using size_type = size_t;
+//   using difference_type = ptrdiff_t;
+//   using pointer = element_type*;
+//   using const_pointer = const element_type*;
+//   using reference = element_type&;
+//   using const_reference = const element_type&;
+//   using iterator = implementation-defined;
+//   using const_iterator = implementation-defined;
+//   using reverse_iterator = std::reverse_iterator<iterator>;
+//   using const_reverse_iterator = std::reverse_iterator<const_iterator>;
+//   static constexpr size_type extent = Extent;
----------------
frederick-vs-ja wrote:

These comments look worse than before to me. Also, `const_iterator` and `const_reverse_iterator` are different things. They're not yet implemented, which is somehow due to me (#99915).

Anyway, let's fix the comments and remove unimplemented things for now.
```suggestion
//   // constants and types
//   using element_type                = ElementType;
//   using value_type                  = remove_cv_t<ElementType>;
//   using size_type                   = size_t;
//   using difference_type             = ptrdiff_t;
//   using pointer                     = element_type*;
//   using const_pointer               = const element_type*;
//   using reference                   = element_type&;
//   using const_reference             = const element_type&;
//   using iterator                    = implementation-defined;
//   using reverse_iterator            = std::reverse_iterator<iterator>;
//   static constexpr size_type extent = Extent;
```

https://github.com/llvm/llvm-project/pull/202319


More information about the libcxx-commits mailing list