[libcxx-commits] [PATCH] D111838: [libc++] Implement LWG3369, tweak CTAD for std::span.

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Oct 14 14:05:54 PDT 2021


Quuxplusone created this revision.
Quuxplusone added reviewers: jloser, ldionne, libc++.
Quuxplusone added a project: libc++.
Quuxplusone requested review of this revision.
Herald added a subscriber: libcxx-commits.
Herald added 1 blocking reviewer(s): libc++.

The original bug doesn't reproduce on Clang, allegedly because of
https://bugs.llvm.org/show_bug.cgi?id=44484
We already test STL's exact test case, in `span.cons/deduct.pass.cpp`, which I'm touching just for the heck of it.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D111838

Files:
  libcxx/docs/Status/Cxx20Issues.csv
  libcxx/include/span
  libcxx/test/std/containers/views/span.cons/deduct.pass.cpp


Index: libcxx/test/std/containers/views/span.cons/deduct.pass.cpp
===================================================================
--- libcxx/test/std/containers/views/span.cons/deduct.pass.cpp
+++ libcxx/test/std/containers/views/span.cons/deduct.pass.cpp
@@ -6,11 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 // UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-no-concepts
 // UNSUPPORTED: libcpp-has-no-incomplete-ranges
 
-// AppleClang 12.0.0 doesn't fully support ranges/concepts
-// XFAIL: apple-clang-12.0.0
-
 // <span>
 
 //   template<class It, class EndOrSize>
Index: libcxx/include/span
===================================================================
--- libcxx/include/span
+++ libcxx/include/span
@@ -61,7 +61,7 @@
     template <class It, class End>
     constexpr explicit(Extent != dynamic_extent) span(It first, End last);
     template <size_t N>
-        constexpr span(element_type (&arr)[N]) noexcept;
+        constexpr span(type_identity_t<element_type> (&arr)[N]) noexcept;
     template <size_t N>
         constexpr span(array<value_type, N>& arr) noexcept;
     template <size_t N>
@@ -236,7 +236,7 @@
     }
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY constexpr span(element_type (&__arr)[_Extent])          noexcept : __data{__arr} {}
+    _LIBCPP_INLINE_VISIBILITY constexpr span(type_identity_t<element_type> (&__arr)[_Extent]) noexcept : __data{__arr} {}
 
     template <class _OtherElementType,
               enable_if_t<is_convertible_v<_OtherElementType(*)[], element_type (*)[]>, nullptr_t> = nullptr>
@@ -422,7 +422,7 @@
 
     template <size_t _Sz>
     _LIBCPP_INLINE_VISIBILITY
-    constexpr span(element_type (&__arr)[_Sz])          noexcept : __data{__arr}, __size{_Sz} {}
+    constexpr span(type_identity_t<element_type> (&__arr)[_Sz]) noexcept : __data{__arr}, __size{_Sz} {}
 
     template <class _OtherElementType, size_t _Sz,
               enable_if_t<is_convertible_v<_OtherElementType(*)[], element_type (*)[]>, nullptr_t> = nullptr>
Index: libcxx/docs/Status/Cxx20Issues.csv
===================================================================
--- libcxx/docs/Status/Cxx20Issues.csv
+++ libcxx/docs/Status/Cxx20Issues.csv
@@ -274,7 +274,7 @@
 "`3363 <https://wg21.link/LWG3363>`__","``drop_while_view``\  should opt-out of ``sized_range``\ ","Prague","",""
 "`3364 <https://wg21.link/LWG3364>`__","Initialize data members of ranges and their iterators","Prague","",""
 "`3367 <https://wg21.link/LWG3367>`__","Integer-class conversions should not throw","Prague","",""
-"`3369 <https://wg21.link/LWG3369>`__","``span``\ 's deduction-guide for built-in arrays doesn't work","Prague","",""
+"`3369 <https://wg21.link/LWG3369>`__","``span``\ 's deduction-guide for built-in arrays doesn't work","Prague","|Complete|","14.0"
 "`3371 <https://wg21.link/LWG3371>`__","``visit_format_arg``\  and ``make_format_args``\  are not hidden friends","Prague","|Complete|","14.0"
 "`3372 <https://wg21.link/LWG3372>`__","``vformat_to``\  should not try to deduce ``Out``\  twice","Prague","",""
 "`3373 <https://wg21.link/LWG3373>`__","``{to,from}_chars_result``\  and ``format_to_n_result``\  need the  ""we really mean what we say"" wording","Prague","",""


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111838.379838.patch
Type: text/x-patch
Size: 3269 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211014/c778d484/attachment.bin>


More information about the libcxx-commits mailing list