[lld] [libc] [mlir] [openmp] [llvm] [libcxxabi] [flang] [lldb] [libcxx] [clang-tools-extra] [clang] [compiler-rt] [libc++] Fix `take_view::__sentinel`'s `operator==` (PR #74655)

2023-12-07 Thread Jakub Mazurkiewicz via cfe-commits

https://github.com/JMazurkiewicz updated 
https://github.com/llvm/llvm-project/pull/74655

>From b3de573887cdd86fd6ce168bdcc6d729d73b13b2 Mon Sep 17 00:00:00 2001
From: Jakub Mazurkiewicz 
Date: Wed, 6 Dec 2023 14:03:51 +0100
Subject: [PATCH 1/9] [libc++] Fix `take_view::__sentinel`'s `operator==`

---
 libcxx/include/__ranges/take_view.h   |   2 +-
 .../base.pass.cpp |   5 +-
 .../ctor.pass.cpp |   0
 .../range.take.sentinel/eq.pass.cpp   | 192 ++
 .../range.take/sentinel/eq.pass.cpp   |  55 -
 5 files changed, 194 insertions(+), 60 deletions(-)
 rename libcxx/test/std/ranges/range.adaptors/range.take/{sentinel => 
range.take.sentinel}/base.pass.cpp (83%)
 rename libcxx/test/std/ranges/range.adaptors/range.take/{sentinel => 
range.take.sentinel}/ctor.pass.cpp (100%)
 create mode 100644 
libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
 delete mode 100644 
libcxx/test/std/ranges/range.adaptors/range.take/sentinel/eq.pass.cpp

diff --git a/libcxx/include/__ranges/take_view.h 
b/libcxx/include/__ranges/take_view.h
index 4204017d9249b..811428e529f59 100644
--- a/libcxx/include/__ranges/take_view.h
+++ b/libcxx/include/__ranges/take_view.h
@@ -183,7 +183,7 @@ class take_view<_View>::__sentinel {
   template
 requires sentinel_for, 
iterator_t<__maybe_const<_OtherConst, _View>>>
   _LIBCPP_HIDE_FROM_ABI
-  friend constexpr bool operator==(const _Iter<_Const>& __lhs, const 
__sentinel& __rhs) {
+  friend constexpr bool operator==(const _Iter<_OtherConst>& __lhs, const 
__sentinel& __rhs) {
 return __lhs.count() == 0 || __lhs.base() == __rhs.__end_;
   }
 };
diff --git 
a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/base.pass.cpp
similarity index 83%
rename from 
libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp
rename to 
libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/base.pass.cpp
index c949eb7cc0846..15b2b5476e86d 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp
+++ 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/base.pass.cpp
@@ -8,10 +8,7 @@
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
 
-// sentinel() = default;
-// constexpr explicit sentinel(sentinel_t end);
-// constexpr sentinel(sentinel s)
-//   requires Const && convertible_to, sentinel_t>;
+// constexpr sentinel_t base() const;
 
 #include 
 #include 
diff --git 
a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/ctor.pass.cpp 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/ctor.pass.cpp
similarity index 100%
rename from 
libcxx/test/std/ranges/range.adaptors/range.take/sentinel/ctor.pass.cpp
rename to 
libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/ctor.pass.cpp
diff --git 
a/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
new file mode 100644
index 0..f20c29b4c6471
--- /dev/null
+++ 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
@@ -0,0 +1,192 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+
+// friend constexpr bool operator==(const CI& y, const sentinel& x);
+// template
+//   requires sentinel_for, 
iterator_t>>
+// friend constexpr bool operator==(const CI& y, const sentinel& 
x);
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "test_iterators.h"
+
+template 
+class StrictIterator {
+  using Base = std::conditional_t;
+  Base base_;
+
+public:
+  using value_type  = int;
+  using difference_type = std::ptrdiff_t;
+
+  constexpr explicit StrictIterator(Base base) : base_(base) {}
+
+  StrictIterator(StrictIterator&&)= default;
+  StrictIterator& operator=(StrictIterator&&) = default;
+
+  constexpr StrictIterator& operator++() {
+++base_;
+return *this;
+  }
+
+  constexpr void operator++(int) { ++*this; }
+  constexpr decltype(auto) operator*() const { return *base_; }
+  constexpr Base base() const { return base_; }
+};
+
+static_assert(std::input_iterator>);
+static_assert(!std::copyable>);
+static_assert(!std::forward_iterator>);
+static_assert(std::input_iterator>);
+static_assert(!std::copyable>);
+static_assert(!std::forward_iterator>);
+
+template 
+class StrictSentinel {
+  using Base = std::conditional_t;
+  Base base_;
+
+public:
+  StrictSentinel() = default;
+ 

[libc] [openmp] [lldb] [llvm] [flang] [compiler-rt] [lld] [mlir] [libcxx] [clang] [clang-tools-extra] [libcxxabi] [libc++] Fix `take_view::__sentinel`'s `operator==` (PR #74655)

2023-12-07 Thread Jakub Mazurkiewicz via cfe-commits

https://github.com/JMazurkiewicz updated 
https://github.com/llvm/llvm-project/pull/74655

>From b3de573887cdd86fd6ce168bdcc6d729d73b13b2 Mon Sep 17 00:00:00 2001
From: Jakub Mazurkiewicz 
Date: Wed, 6 Dec 2023 14:03:51 +0100
Subject: [PATCH 01/10] [libc++] Fix `take_view::__sentinel`'s `operator==`

---
 libcxx/include/__ranges/take_view.h   |   2 +-
 .../base.pass.cpp |   5 +-
 .../ctor.pass.cpp |   0
 .../range.take.sentinel/eq.pass.cpp   | 192 ++
 .../range.take/sentinel/eq.pass.cpp   |  55 -
 5 files changed, 194 insertions(+), 60 deletions(-)
 rename libcxx/test/std/ranges/range.adaptors/range.take/{sentinel => 
range.take.sentinel}/base.pass.cpp (83%)
 rename libcxx/test/std/ranges/range.adaptors/range.take/{sentinel => 
range.take.sentinel}/ctor.pass.cpp (100%)
 create mode 100644 
libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
 delete mode 100644 
libcxx/test/std/ranges/range.adaptors/range.take/sentinel/eq.pass.cpp

diff --git a/libcxx/include/__ranges/take_view.h 
b/libcxx/include/__ranges/take_view.h
index 4204017d9249b..811428e529f59 100644
--- a/libcxx/include/__ranges/take_view.h
+++ b/libcxx/include/__ranges/take_view.h
@@ -183,7 +183,7 @@ class take_view<_View>::__sentinel {
   template
 requires sentinel_for, 
iterator_t<__maybe_const<_OtherConst, _View>>>
   _LIBCPP_HIDE_FROM_ABI
-  friend constexpr bool operator==(const _Iter<_Const>& __lhs, const 
__sentinel& __rhs) {
+  friend constexpr bool operator==(const _Iter<_OtherConst>& __lhs, const 
__sentinel& __rhs) {
 return __lhs.count() == 0 || __lhs.base() == __rhs.__end_;
   }
 };
diff --git 
a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/base.pass.cpp
similarity index 83%
rename from 
libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp
rename to 
libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/base.pass.cpp
index c949eb7cc0846..15b2b5476e86d 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp
+++ 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/base.pass.cpp
@@ -8,10 +8,7 @@
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
 
-// sentinel() = default;
-// constexpr explicit sentinel(sentinel_t end);
-// constexpr sentinel(sentinel s)
-//   requires Const && convertible_to, sentinel_t>;
+// constexpr sentinel_t base() const;
 
 #include 
 #include 
diff --git 
a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/ctor.pass.cpp 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/ctor.pass.cpp
similarity index 100%
rename from 
libcxx/test/std/ranges/range.adaptors/range.take/sentinel/ctor.pass.cpp
rename to 
libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/ctor.pass.cpp
diff --git 
a/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
new file mode 100644
index 0..f20c29b4c6471
--- /dev/null
+++ 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
@@ -0,0 +1,192 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+
+// friend constexpr bool operator==(const CI& y, const sentinel& x);
+// template
+//   requires sentinel_for, 
iterator_t>>
+// friend constexpr bool operator==(const CI& y, const sentinel& 
x);
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "test_iterators.h"
+
+template 
+class StrictIterator {
+  using Base = std::conditional_t;
+  Base base_;
+
+public:
+  using value_type  = int;
+  using difference_type = std::ptrdiff_t;
+
+  constexpr explicit StrictIterator(Base base) : base_(base) {}
+
+  StrictIterator(StrictIterator&&)= default;
+  StrictIterator& operator=(StrictIterator&&) = default;
+
+  constexpr StrictIterator& operator++() {
+++base_;
+return *this;
+  }
+
+  constexpr void operator++(int) { ++*this; }
+  constexpr decltype(auto) operator*() const { return *base_; }
+  constexpr Base base() const { return base_; }
+};
+
+static_assert(std::input_iterator>);
+static_assert(!std::copyable>);
+static_assert(!std::forward_iterator>);
+static_assert(std::input_iterator>);
+static_assert(!std::copyable>);
+static_assert(!std::forward_iterator>);
+
+template 
+class StrictSentinel {
+  using Base = std::conditional_t;
+  Base base_;
+
+public:
+  StrictSentinel() = default;

[libcxxabi] [libc] [clang] [clang-tools-extra] [lld] [openmp] [compiler-rt] [libcxx] [flang] [lldb] [mlir] [llvm] [libc++] Fix `take_view::__sentinel`'s `operator==` (PR #74655)

2023-12-07 Thread Jakub Mazurkiewicz via cfe-commits

https://github.com/JMazurkiewicz updated 
https://github.com/llvm/llvm-project/pull/74655

>From b3de573887cdd86fd6ce168bdcc6d729d73b13b2 Mon Sep 17 00:00:00 2001
From: Jakub Mazurkiewicz 
Date: Wed, 6 Dec 2023 14:03:51 +0100
Subject: [PATCH 01/10] [libc++] Fix `take_view::__sentinel`'s `operator==`

---
 libcxx/include/__ranges/take_view.h   |   2 +-
 .../base.pass.cpp |   5 +-
 .../ctor.pass.cpp |   0
 .../range.take.sentinel/eq.pass.cpp   | 192 ++
 .../range.take/sentinel/eq.pass.cpp   |  55 -
 5 files changed, 194 insertions(+), 60 deletions(-)
 rename libcxx/test/std/ranges/range.adaptors/range.take/{sentinel => 
range.take.sentinel}/base.pass.cpp (83%)
 rename libcxx/test/std/ranges/range.adaptors/range.take/{sentinel => 
range.take.sentinel}/ctor.pass.cpp (100%)
 create mode 100644 
libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
 delete mode 100644 
libcxx/test/std/ranges/range.adaptors/range.take/sentinel/eq.pass.cpp

diff --git a/libcxx/include/__ranges/take_view.h 
b/libcxx/include/__ranges/take_view.h
index 4204017d9249b..811428e529f59 100644
--- a/libcxx/include/__ranges/take_view.h
+++ b/libcxx/include/__ranges/take_view.h
@@ -183,7 +183,7 @@ class take_view<_View>::__sentinel {
   template
 requires sentinel_for, 
iterator_t<__maybe_const<_OtherConst, _View>>>
   _LIBCPP_HIDE_FROM_ABI
-  friend constexpr bool operator==(const _Iter<_Const>& __lhs, const 
__sentinel& __rhs) {
+  friend constexpr bool operator==(const _Iter<_OtherConst>& __lhs, const 
__sentinel& __rhs) {
 return __lhs.count() == 0 || __lhs.base() == __rhs.__end_;
   }
 };
diff --git 
a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/base.pass.cpp
similarity index 83%
rename from 
libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp
rename to 
libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/base.pass.cpp
index c949eb7cc0846..15b2b5476e86d 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp
+++ 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/base.pass.cpp
@@ -8,10 +8,7 @@
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
 
-// sentinel() = default;
-// constexpr explicit sentinel(sentinel_t end);
-// constexpr sentinel(sentinel s)
-//   requires Const && convertible_to, sentinel_t>;
+// constexpr sentinel_t base() const;
 
 #include 
 #include 
diff --git 
a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/ctor.pass.cpp 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/ctor.pass.cpp
similarity index 100%
rename from 
libcxx/test/std/ranges/range.adaptors/range.take/sentinel/ctor.pass.cpp
rename to 
libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/ctor.pass.cpp
diff --git 
a/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
new file mode 100644
index 0..f20c29b4c6471
--- /dev/null
+++ 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
@@ -0,0 +1,192 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+
+// friend constexpr bool operator==(const CI& y, const sentinel& x);
+// template
+//   requires sentinel_for, 
iterator_t>>
+// friend constexpr bool operator==(const CI& y, const sentinel& 
x);
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "test_iterators.h"
+
+template 
+class StrictIterator {
+  using Base = std::conditional_t;
+  Base base_;
+
+public:
+  using value_type  = int;
+  using difference_type = std::ptrdiff_t;
+
+  constexpr explicit StrictIterator(Base base) : base_(base) {}
+
+  StrictIterator(StrictIterator&&)= default;
+  StrictIterator& operator=(StrictIterator&&) = default;
+
+  constexpr StrictIterator& operator++() {
+++base_;
+return *this;
+  }
+
+  constexpr void operator++(int) { ++*this; }
+  constexpr decltype(auto) operator*() const { return *base_; }
+  constexpr Base base() const { return base_; }
+};
+
+static_assert(std::input_iterator>);
+static_assert(!std::copyable>);
+static_assert(!std::forward_iterator>);
+static_assert(std::input_iterator>);
+static_assert(!std::copyable>);
+static_assert(!std::forward_iterator>);
+
+template 
+class StrictSentinel {
+  using Base = std::conditional_t;
+  Base base_;
+
+public:
+  StrictSentinel() = default;

[libcxx] [llvm] [lldb] [lld] [clang-tools-extra] [flang] [compiler-rt] [libcxxabi] [clang] [mlir] [libc] [openmp] [libc++] Fix `take_view::__sentinel`'s `operator==` (PR #74655)

2023-12-07 Thread Jakub Mazurkiewicz via cfe-commits


@@ -183,7 +183,7 @@ class take_view<_View>::__sentinel {
   template
 requires sentinel_for, 
iterator_t<__maybe_const<_OtherConst, _View>>>
   _LIBCPP_HIDE_FROM_ABI
-  friend constexpr bool operator==(const _Iter<_Const>& __lhs, const 
__sentinel& __rhs) {
+  friend constexpr bool operator==(const _Iter<_OtherConst>& __lhs, const 
__sentinel& __rhs) {
 return __lhs.count() == 0 || __lhs.base() == __rhs.__end_;
   }

JMazurkiewicz wrote:

I've tried changing default argument to `_Const` and removing it, and in both 
cases test failed. I think that current coverage is enough.

https://github.com/llvm/llvm-project/pull/74655
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[flang] [openmp] [compiler-rt] [libc] [lld] [lldb] [clang-tools-extra] [libcxx] [clang] [mlir] [llvm] [libcxxabi] [libc++] Fix `take_view::__sentinel`'s `operator==` (PR #74655)

2023-12-07 Thread Jakub Mazurkiewicz via cfe-commits

https://github.com/JMazurkiewicz updated 
https://github.com/llvm/llvm-project/pull/74655

>From b3de573887cdd86fd6ce168bdcc6d729d73b13b2 Mon Sep 17 00:00:00 2001
From: Jakub Mazurkiewicz 
Date: Wed, 6 Dec 2023 14:03:51 +0100
Subject: [PATCH 01/11] [libc++] Fix `take_view::__sentinel`'s `operator==`

---
 libcxx/include/__ranges/take_view.h   |   2 +-
 .../base.pass.cpp |   5 +-
 .../ctor.pass.cpp |   0
 .../range.take.sentinel/eq.pass.cpp   | 192 ++
 .../range.take/sentinel/eq.pass.cpp   |  55 -
 5 files changed, 194 insertions(+), 60 deletions(-)
 rename libcxx/test/std/ranges/range.adaptors/range.take/{sentinel => 
range.take.sentinel}/base.pass.cpp (83%)
 rename libcxx/test/std/ranges/range.adaptors/range.take/{sentinel => 
range.take.sentinel}/ctor.pass.cpp (100%)
 create mode 100644 
libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
 delete mode 100644 
libcxx/test/std/ranges/range.adaptors/range.take/sentinel/eq.pass.cpp

diff --git a/libcxx/include/__ranges/take_view.h 
b/libcxx/include/__ranges/take_view.h
index 4204017d9249b..811428e529f59 100644
--- a/libcxx/include/__ranges/take_view.h
+++ b/libcxx/include/__ranges/take_view.h
@@ -183,7 +183,7 @@ class take_view<_View>::__sentinel {
   template
 requires sentinel_for, 
iterator_t<__maybe_const<_OtherConst, _View>>>
   _LIBCPP_HIDE_FROM_ABI
-  friend constexpr bool operator==(const _Iter<_Const>& __lhs, const 
__sentinel& __rhs) {
+  friend constexpr bool operator==(const _Iter<_OtherConst>& __lhs, const 
__sentinel& __rhs) {
 return __lhs.count() == 0 || __lhs.base() == __rhs.__end_;
   }
 };
diff --git 
a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/base.pass.cpp
similarity index 83%
rename from 
libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp
rename to 
libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/base.pass.cpp
index c949eb7cc0846..15b2b5476e86d 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp
+++ 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/base.pass.cpp
@@ -8,10 +8,7 @@
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
 
-// sentinel() = default;
-// constexpr explicit sentinel(sentinel_t end);
-// constexpr sentinel(sentinel s)
-//   requires Const && convertible_to, sentinel_t>;
+// constexpr sentinel_t base() const;
 
 #include 
 #include 
diff --git 
a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/ctor.pass.cpp 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/ctor.pass.cpp
similarity index 100%
rename from 
libcxx/test/std/ranges/range.adaptors/range.take/sentinel/ctor.pass.cpp
rename to 
libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/ctor.pass.cpp
diff --git 
a/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
new file mode 100644
index 0..f20c29b4c6471
--- /dev/null
+++ 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
@@ -0,0 +1,192 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+
+// friend constexpr bool operator==(const CI& y, const sentinel& x);
+// template
+//   requires sentinel_for, 
iterator_t>>
+// friend constexpr bool operator==(const CI& y, const sentinel& 
x);
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "test_iterators.h"
+
+template 
+class StrictIterator {
+  using Base = std::conditional_t;
+  Base base_;
+
+public:
+  using value_type  = int;
+  using difference_type = std::ptrdiff_t;
+
+  constexpr explicit StrictIterator(Base base) : base_(base) {}
+
+  StrictIterator(StrictIterator&&)= default;
+  StrictIterator& operator=(StrictIterator&&) = default;
+
+  constexpr StrictIterator& operator++() {
+++base_;
+return *this;
+  }
+
+  constexpr void operator++(int) { ++*this; }
+  constexpr decltype(auto) operator*() const { return *base_; }
+  constexpr Base base() const { return base_; }
+};
+
+static_assert(std::input_iterator>);
+static_assert(!std::copyable>);
+static_assert(!std::forward_iterator>);
+static_assert(std::input_iterator>);
+static_assert(!std::copyable>);
+static_assert(!std::forward_iterator>);
+
+template 
+class StrictSentinel {
+  using Base = std::conditional_t;
+  Base base_;
+
+public:
+  StrictSentinel() = default;

[flang] [lld] [clang] [lldb] [mlir] [compiler-rt] [llvm] [libcxx] [openmp] [clang-tools-extra] [libc] [libcxxabi] [libc++] Fix `take_view::__sentinel`'s `operator==` (PR #74655)

2023-12-12 Thread Jakub Mazurkiewicz via cfe-commits

https://github.com/JMazurkiewicz updated 
https://github.com/llvm/llvm-project/pull/74655

>From b3de573887cdd86fd6ce168bdcc6d729d73b13b2 Mon Sep 17 00:00:00 2001
From: Jakub Mazurkiewicz 
Date: Wed, 6 Dec 2023 14:03:51 +0100
Subject: [PATCH 01/11] [libc++] Fix `take_view::__sentinel`'s `operator==`

---
 libcxx/include/__ranges/take_view.h   |   2 +-
 .../base.pass.cpp |   5 +-
 .../ctor.pass.cpp |   0
 .../range.take.sentinel/eq.pass.cpp   | 192 ++
 .../range.take/sentinel/eq.pass.cpp   |  55 -
 5 files changed, 194 insertions(+), 60 deletions(-)
 rename libcxx/test/std/ranges/range.adaptors/range.take/{sentinel => 
range.take.sentinel}/base.pass.cpp (83%)
 rename libcxx/test/std/ranges/range.adaptors/range.take/{sentinel => 
range.take.sentinel}/ctor.pass.cpp (100%)
 create mode 100644 
libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
 delete mode 100644 
libcxx/test/std/ranges/range.adaptors/range.take/sentinel/eq.pass.cpp

diff --git a/libcxx/include/__ranges/take_view.h 
b/libcxx/include/__ranges/take_view.h
index 4204017d9249bc..811428e529f59a 100644
--- a/libcxx/include/__ranges/take_view.h
+++ b/libcxx/include/__ranges/take_view.h
@@ -183,7 +183,7 @@ class take_view<_View>::__sentinel {
   template
 requires sentinel_for, 
iterator_t<__maybe_const<_OtherConst, _View>>>
   _LIBCPP_HIDE_FROM_ABI
-  friend constexpr bool operator==(const _Iter<_Const>& __lhs, const 
__sentinel& __rhs) {
+  friend constexpr bool operator==(const _Iter<_OtherConst>& __lhs, const 
__sentinel& __rhs) {
 return __lhs.count() == 0 || __lhs.base() == __rhs.__end_;
   }
 };
diff --git 
a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/base.pass.cpp
similarity index 83%
rename from 
libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp
rename to 
libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/base.pass.cpp
index c949eb7cc08469..15b2b5476e86dd 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp
+++ 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/base.pass.cpp
@@ -8,10 +8,7 @@
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
 
-// sentinel() = default;
-// constexpr explicit sentinel(sentinel_t end);
-// constexpr sentinel(sentinel s)
-//   requires Const && convertible_to, sentinel_t>;
+// constexpr sentinel_t base() const;
 
 #include 
 #include 
diff --git 
a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/ctor.pass.cpp 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/ctor.pass.cpp
similarity index 100%
rename from 
libcxx/test/std/ranges/range.adaptors/range.take/sentinel/ctor.pass.cpp
rename to 
libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/ctor.pass.cpp
diff --git 
a/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
new file mode 100644
index 00..f20c29b4c64714
--- /dev/null
+++ 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
@@ -0,0 +1,192 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+
+// friend constexpr bool operator==(const CI& y, const sentinel& x);
+// template
+//   requires sentinel_for, 
iterator_t>>
+// friend constexpr bool operator==(const CI& y, const sentinel& 
x);
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "test_iterators.h"
+
+template 
+class StrictIterator {
+  using Base = std::conditional_t;
+  Base base_;
+
+public:
+  using value_type  = int;
+  using difference_type = std::ptrdiff_t;
+
+  constexpr explicit StrictIterator(Base base) : base_(base) {}
+
+  StrictIterator(StrictIterator&&)= default;
+  StrictIterator& operator=(StrictIterator&&) = default;
+
+  constexpr StrictIterator& operator++() {
+++base_;
+return *this;
+  }
+
+  constexpr void operator++(int) { ++*this; }
+  constexpr decltype(auto) operator*() const { return *base_; }
+  constexpr Base base() const { return base_; }
+};
+
+static_assert(std::input_iterator>);
+static_assert(!std::copyable>);
+static_assert(!std::forward_iterator>);
+static_assert(std::input_iterator>);
+static_assert(!std::copyable>);
+static_assert(!std::forward_iterator>);
+
+template 
+class StrictSentinel {
+  using Base = std::conditional_t;
+  Base base_;
+
+public:
+  StrictSentinel() = def

[clang] [libcxx] [clang-tools-extra] [llvm] [libc++] P2770R0: "Stashing stashing iterators for proper flattening" (PR #66033)

2023-12-12 Thread Jakub Mazurkiewicz via cfe-commits

JMazurkiewicz wrote:

Ping @ldionne, CI is green (except for code formatting).

https://github.com/llvm/llvm-project/pull/66033
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [libc] [flang] [openmp] [mlir] [libcxx] [llvm] [lld] [libcxxabi] [compiler-rt] [clang-tools-extra] [lldb] [libc++] Fix `take_view::__sentinel`'s `operator==` (PR #74655)

2023-12-13 Thread Jakub Mazurkiewicz via cfe-commits

https://github.com/JMazurkiewicz updated 
https://github.com/llvm/llvm-project/pull/74655

>From b3de573887cdd86fd6ce168bdcc6d729d73b13b2 Mon Sep 17 00:00:00 2001
From: Jakub Mazurkiewicz 
Date: Wed, 6 Dec 2023 14:03:51 +0100
Subject: [PATCH 01/12] [libc++] Fix `take_view::__sentinel`'s `operator==`

---
 libcxx/include/__ranges/take_view.h   |   2 +-
 .../base.pass.cpp |   5 +-
 .../ctor.pass.cpp |   0
 .../range.take.sentinel/eq.pass.cpp   | 192 ++
 .../range.take/sentinel/eq.pass.cpp   |  55 -
 5 files changed, 194 insertions(+), 60 deletions(-)
 rename libcxx/test/std/ranges/range.adaptors/range.take/{sentinel => 
range.take.sentinel}/base.pass.cpp (83%)
 rename libcxx/test/std/ranges/range.adaptors/range.take/{sentinel => 
range.take.sentinel}/ctor.pass.cpp (100%)
 create mode 100644 
libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
 delete mode 100644 
libcxx/test/std/ranges/range.adaptors/range.take/sentinel/eq.pass.cpp

diff --git a/libcxx/include/__ranges/take_view.h 
b/libcxx/include/__ranges/take_view.h
index 4204017d9249bc..811428e529f59a 100644
--- a/libcxx/include/__ranges/take_view.h
+++ b/libcxx/include/__ranges/take_view.h
@@ -183,7 +183,7 @@ class take_view<_View>::__sentinel {
   template
 requires sentinel_for, 
iterator_t<__maybe_const<_OtherConst, _View>>>
   _LIBCPP_HIDE_FROM_ABI
-  friend constexpr bool operator==(const _Iter<_Const>& __lhs, const 
__sentinel& __rhs) {
+  friend constexpr bool operator==(const _Iter<_OtherConst>& __lhs, const 
__sentinel& __rhs) {
 return __lhs.count() == 0 || __lhs.base() == __rhs.__end_;
   }
 };
diff --git 
a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/base.pass.cpp
similarity index 83%
rename from 
libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp
rename to 
libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/base.pass.cpp
index c949eb7cc08469..15b2b5476e86dd 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp
+++ 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/base.pass.cpp
@@ -8,10 +8,7 @@
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
 
-// sentinel() = default;
-// constexpr explicit sentinel(sentinel_t end);
-// constexpr sentinel(sentinel s)
-//   requires Const && convertible_to, sentinel_t>;
+// constexpr sentinel_t base() const;
 
 #include 
 #include 
diff --git 
a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/ctor.pass.cpp 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/ctor.pass.cpp
similarity index 100%
rename from 
libcxx/test/std/ranges/range.adaptors/range.take/sentinel/ctor.pass.cpp
rename to 
libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/ctor.pass.cpp
diff --git 
a/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
new file mode 100644
index 00..f20c29b4c64714
--- /dev/null
+++ 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
@@ -0,0 +1,192 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+
+// friend constexpr bool operator==(const CI& y, const sentinel& x);
+// template
+//   requires sentinel_for, 
iterator_t>>
+// friend constexpr bool operator==(const CI& y, const sentinel& 
x);
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "test_iterators.h"
+
+template 
+class StrictIterator {
+  using Base = std::conditional_t;
+  Base base_;
+
+public:
+  using value_type  = int;
+  using difference_type = std::ptrdiff_t;
+
+  constexpr explicit StrictIterator(Base base) : base_(base) {}
+
+  StrictIterator(StrictIterator&&)= default;
+  StrictIterator& operator=(StrictIterator&&) = default;
+
+  constexpr StrictIterator& operator++() {
+++base_;
+return *this;
+  }
+
+  constexpr void operator++(int) { ++*this; }
+  constexpr decltype(auto) operator*() const { return *base_; }
+  constexpr Base base() const { return base_; }
+};
+
+static_assert(std::input_iterator>);
+static_assert(!std::copyable>);
+static_assert(!std::forward_iterator>);
+static_assert(std::input_iterator>);
+static_assert(!std::copyable>);
+static_assert(!std::forward_iterator>);
+
+template 
+class StrictSentinel {
+  using Base = std::conditional_t;
+  Base base_;
+
+public:
+  StrictSentinel() = def

[mlir] [lldb] [clang-tools-extra] [compiler-rt] [libcxx] [lld] [llvm] [libc] [flang] [openmp] [libcxxabi] [clang] [libc++] Fix `take_view::__sentinel`'s `operator==` (PR #74655)

2023-12-13 Thread Jakub Mazurkiewicz via cfe-commits

JMazurkiewicz wrote:

@huixie90 CI is *almost* green (Android failure is probably unrelated).

https://github.com/llvm/llvm-project/pull/74655
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] [llvm] [clang] [clang-tools-extra] [libc++] P2770R0: "Stashing stashing iterators for proper flattening" (PR #66033)

2023-11-27 Thread Jakub Mazurkiewicz via cfe-commits

https://github.com/JMazurkiewicz updated 
https://github.com/llvm/llvm-project/pull/66033

>From 600a282d49011782fde23c4388ba1346284153a1 Mon Sep 17 00:00:00 2001
From: Jakub Mazurkiewicz 
Date: Fri, 8 Sep 2023 18:20:59 +0200
Subject: [PATCH 01/11] [libc++] P2770R0: "Stashing stashing iterators for
 proper flattening"

* Parially implements P2770R0: "Stashing stashing iterators for proper 
flattening"
* `join_with_view` hasn't been done yet since this type isn't implemented yet
* Rename `test/libcxx/ranges/range.adaptors/range.adaptor.tuple` directory to 
`test/libcxx/ranges/range.adaptors/range.adaptor.helpers` to match the 
standard: http://eel.is/c++draft/range.adaptor.helpers (this change happened in 
P2770R0, see point 3 of wording).
* Rename `libcxx\test\std\ranges\range.adaptors\range.join.view` to 
`libcxx\test\std\ranges\range.adaptors\range.join` to match the standard
---
 libcxx/docs/Status/Cxx23.rst  |   1 +
 libcxx/docs/Status/Cxx23Papers.csv|   2 +-
 libcxx/docs/UsingLibcxx.rst   |   1 -
 libcxx/include/CMakeLists.txt |   1 +
 libcxx/include/__ranges/join_view.h   | 132 +++---
 libcxx/include/__utility/as_lvalue.h  |  39 ++
 libcxx/include/module.modulemap.in|   1 +
 libcxx/include/regex  |   8 ++
 libcxx/include/utility|   1 +
 libcxx/modules/std/ranges.inc |   2 -
 .../as-lvalue.verify.cpp  |  48 +++
 .../tuple-for-each.pass.cpp   |   0
 .../segmented_iterator.compile.pass.cpp   |   1 -
 .../alg.copy/ranges.copy.segmented.pass.cpp   |   2 -
 .../alg.copy/ranges.copy_backward.pass.cpp|   2 -
 .../iterator/ctor.parent.outer.pass.cpp   |  57 
 .../adaptor.pass.cpp  |   1 -
 .../base.pass.cpp |   1 -
 .../begin.pass.cpp|  31 +++-
 .../ctad.compile.pass.cpp |   1 -
 .../ctad.verify.cpp   |   1 -
 .../ctor.default.pass.cpp |   1 -
 .../ctor.view.pass.cpp|   1 -
 .../end.pass.cpp  |  22 +--
 .../general.pass.cpp  |   1 -
 .../range.join.iterator}/arrow.pass.cpp   |   1 -
 .../ctor.default.pass.cpp |  16 +--
 .../range.join.iterator}/ctor.other.pass.cpp  |   3 +-
 .../range.join.iterator}/decrement.pass.cpp   |  13 +-
 .../range.join.iterator}/eq.pass.cpp  |   7 +-
 .../range.join.iterator}/increment.pass.cpp   |  18 ++-
 .../range.join.iterator}/iter.move.pass.cpp   |   1 -
 .../range.join.iterator}/iter.swap.pass.cpp   |   1 -
 .../member_types.compile.pass.cpp |   1 -
 .../range.join.iterator}/star.pass.cpp|   1 -
 .../ctor.default.pass.cpp |   1 -
 .../range.join.sentinel}/ctor.other.pass.cpp  |   1 -
 .../range.join.sentinel}/ctor.parent.pass.cpp |   1 -
 .../range.join.sentinel}/eq.pass.cpp  |  19 ++-
 .../{range.join.view => range.join}/types.h   |  66 -
 ...rator_concept_conformance.compile.pass.cpp |   4 +-
 .../std/re/re.iter/re.regiter/types.pass.cpp  |   4 +
 ...rator_concept_conformance.compile.pass.cpp |   4 +-
 .../std/re/re.iter/re.tokiter/types.pass.cpp  |   4 +
 libcxx/utils/data/ignore_format.txt   |  45 +++---
 45 files changed, 364 insertions(+), 205 deletions(-)
 create mode 100644 libcxx/include/__utility/as_lvalue.h
 create mode 100644 
libcxx/test/libcxx/ranges/range.adaptors/range.adaptor.helpers/as-lvalue.verify.cpp
 rename libcxx/test/libcxx/ranges/range.adaptors/{range.adaptor.tuple => 
range.adaptor.helpers}/tuple-for-each.pass.cpp (100%)
 delete mode 100644 
libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/ctor.parent.outer.pass.cpp
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/adaptor.pass.cpp (99%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/base.pass.cpp (98%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/begin.pass.cpp (83%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/ctad.compile.pass.cpp (98%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/ctad.verify.cpp (97%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/ctor.default.pass.cpp (97%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/ctor.view.pass.cpp (97%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/end.pass.cpp (95%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/general.pass.cpp (98%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view/iterator => 
range.join/range.join.iterator}/arrow.pass.cpp (99%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.v

[llvm] [clang] [libcxx] [clang-tools-extra] [libc++] P2770R0: "Stashing stashing iterators for proper flattening" (PR #66033)

2023-11-27 Thread Jakub Mazurkiewicz via cfe-commits

https://github.com/JMazurkiewicz updated 
https://github.com/llvm/llvm-project/pull/66033

>From 600a282d49011782fde23c4388ba1346284153a1 Mon Sep 17 00:00:00 2001
From: Jakub Mazurkiewicz 
Date: Fri, 8 Sep 2023 18:20:59 +0200
Subject: [PATCH 01/12] [libc++] P2770R0: "Stashing stashing iterators for
 proper flattening"

* Parially implements P2770R0: "Stashing stashing iterators for proper 
flattening"
* `join_with_view` hasn't been done yet since this type isn't implemented yet
* Rename `test/libcxx/ranges/range.adaptors/range.adaptor.tuple` directory to 
`test/libcxx/ranges/range.adaptors/range.adaptor.helpers` to match the 
standard: http://eel.is/c++draft/range.adaptor.helpers (this change happened in 
P2770R0, see point 3 of wording).
* Rename `libcxx\test\std\ranges\range.adaptors\range.join.view` to 
`libcxx\test\std\ranges\range.adaptors\range.join` to match the standard
---
 libcxx/docs/Status/Cxx23.rst  |   1 +
 libcxx/docs/Status/Cxx23Papers.csv|   2 +-
 libcxx/docs/UsingLibcxx.rst   |   1 -
 libcxx/include/CMakeLists.txt |   1 +
 libcxx/include/__ranges/join_view.h   | 132 +++---
 libcxx/include/__utility/as_lvalue.h  |  39 ++
 libcxx/include/module.modulemap.in|   1 +
 libcxx/include/regex  |   8 ++
 libcxx/include/utility|   1 +
 libcxx/modules/std/ranges.inc |   2 -
 .../as-lvalue.verify.cpp  |  48 +++
 .../tuple-for-each.pass.cpp   |   0
 .../segmented_iterator.compile.pass.cpp   |   1 -
 .../alg.copy/ranges.copy.segmented.pass.cpp   |   2 -
 .../alg.copy/ranges.copy_backward.pass.cpp|   2 -
 .../iterator/ctor.parent.outer.pass.cpp   |  57 
 .../adaptor.pass.cpp  |   1 -
 .../base.pass.cpp |   1 -
 .../begin.pass.cpp|  31 +++-
 .../ctad.compile.pass.cpp |   1 -
 .../ctad.verify.cpp   |   1 -
 .../ctor.default.pass.cpp |   1 -
 .../ctor.view.pass.cpp|   1 -
 .../end.pass.cpp  |  22 +--
 .../general.pass.cpp  |   1 -
 .../range.join.iterator}/arrow.pass.cpp   |   1 -
 .../ctor.default.pass.cpp |  16 +--
 .../range.join.iterator}/ctor.other.pass.cpp  |   3 +-
 .../range.join.iterator}/decrement.pass.cpp   |  13 +-
 .../range.join.iterator}/eq.pass.cpp  |   7 +-
 .../range.join.iterator}/increment.pass.cpp   |  18 ++-
 .../range.join.iterator}/iter.move.pass.cpp   |   1 -
 .../range.join.iterator}/iter.swap.pass.cpp   |   1 -
 .../member_types.compile.pass.cpp |   1 -
 .../range.join.iterator}/star.pass.cpp|   1 -
 .../ctor.default.pass.cpp |   1 -
 .../range.join.sentinel}/ctor.other.pass.cpp  |   1 -
 .../range.join.sentinel}/ctor.parent.pass.cpp |   1 -
 .../range.join.sentinel}/eq.pass.cpp  |  19 ++-
 .../{range.join.view => range.join}/types.h   |  66 -
 ...rator_concept_conformance.compile.pass.cpp |   4 +-
 .../std/re/re.iter/re.regiter/types.pass.cpp  |   4 +
 ...rator_concept_conformance.compile.pass.cpp |   4 +-
 .../std/re/re.iter/re.tokiter/types.pass.cpp  |   4 +
 libcxx/utils/data/ignore_format.txt   |  45 +++---
 45 files changed, 364 insertions(+), 205 deletions(-)
 create mode 100644 libcxx/include/__utility/as_lvalue.h
 create mode 100644 
libcxx/test/libcxx/ranges/range.adaptors/range.adaptor.helpers/as-lvalue.verify.cpp
 rename libcxx/test/libcxx/ranges/range.adaptors/{range.adaptor.tuple => 
range.adaptor.helpers}/tuple-for-each.pass.cpp (100%)
 delete mode 100644 
libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/ctor.parent.outer.pass.cpp
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/adaptor.pass.cpp (99%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/base.pass.cpp (98%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/begin.pass.cpp (83%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/ctad.compile.pass.cpp (98%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/ctad.verify.cpp (97%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/ctor.default.pass.cpp (97%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/ctor.view.pass.cpp (97%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/end.pass.cpp (95%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/general.pass.cpp (98%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view/iterator => 
range.join/range.join.iterator}/arrow.pass.cpp (99%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.v

[libcxx] [llvm] [clang] [clang-tools-extra] [libc++] P2602R2 Poison Pills are Too Toxic (PR #74534)

2024-01-10 Thread Jakub Mazurkiewicz via cfe-commits

https://github.com/JMazurkiewicz updated 
https://github.com/llvm/llvm-project/pull/74534

>From aaccb9e13618517803df1230741b02b4c5ee08c7 Mon Sep 17 00:00:00 2001
From: Jakub Mazurkiewicz 
Date: Tue, 5 Dec 2023 23:36:57 +0100
Subject: [PATCH 1/2] [libc++] P2602R2 Poison Pills are Too Toxic

---
 libcxx/docs/FeatureTestMacroTable.rst |  2 +-
 libcxx/docs/Status/Cxx23Papers.csv|  2 +-
 libcxx/include/__compare/partial_order.h  |  2 ++
 libcxx/include/__compare/strong_order.h   |  2 ++
 libcxx/include/__compare/weak_order.h |  2 ++
 libcxx/include/__iterator/iter_move.h |  2 +-
 libcxx/include/__ranges/access.h  |  6 ++--
 libcxx/include/__ranges/rbegin.h  |  3 +-
 libcxx/include/__ranges/rend.h|  3 +-
 libcxx/include/__ranges/size.h|  3 +-
 libcxx/include/version|  4 +--
 .../iterator.cust.move/iter_move.pass.cpp | 11 +++
 .../iterator.cust.swap/iter_swap.pass.cpp |  6 
 .../ordinary_unqualified_lookup_helpers.h | 33 +++
 .../cmp/cmp.alg/partial_order.pass.cpp|  9 +
 .../cmp/cmp.alg/strong_order.pass.cpp |  9 +
 .../cmp/cmp.alg/weak_order.pass.cpp   |  9 +
 .../algorithm.version.compile.pass.cpp| 14 
 .../functional.version.compile.pass.cpp   | 14 
 .../iterator.version.compile.pass.cpp | 14 
 .../memory.version.compile.pass.cpp   | 14 
 .../ranges.version.compile.pass.cpp   | 14 
 .../version.version.compile.pass.cpp  | 14 
 .../std/ranges/range.access/begin.pass.cpp| 18 +++---
 .../test/std/ranges/range.access/end.pass.cpp | 20 +++
 .../ordinary_unqualified_lookup_helpers.h | 25 ++
 .../std/ranges/range.access/rbegin.pass.cpp   | 18 +++---
 .../std/ranges/range.access/rend.pass.cpp | 20 +++
 .../std/ranges/range.access/size.pass.cpp |  9 -
 .../generate_feature_test_macro_components.py |  2 +-
 30 files changed, 223 insertions(+), 81 deletions(-)
 create mode 100644 
libcxx/test/std/language.support/cmp/cmp.alg/ordinary_unqualified_lookup_helpers.h
 create mode 100644 
libcxx/test/std/ranges/range.access/ordinary_unqualified_lookup_helpers.h

diff --git a/libcxx/docs/FeatureTestMacroTable.rst 
b/libcxx/docs/FeatureTestMacroTable.rst
index d09f65b7cadc0e..f4788aa5747882 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -266,7 +266,7 @@ Status
 --- -
 ``__cpp_lib_polymorphic_allocator`` ``201902L``
 --- -
-``__cpp_lib_ranges````202207L``
+``__cpp_lib_ranges````202211L``
 --- -
 ``__cpp_lib_remove_cvref``  ``201711L``
 --- -
diff --git a/libcxx/docs/Status/Cxx23Papers.csv 
b/libcxx/docs/Status/Cxx23Papers.csv
index e03cbff2a08bbf..7dc6f36ba1e63f 100644
--- a/libcxx/docs/Status/Cxx23Papers.csv
+++ b/libcxx/docs/Status/Cxx23Papers.csv
@@ -100,7 +100,7 @@
 "`P2396R1 `__","LWG", "Concurrency TS 2 fixes ", 
"November 2022","","","|concurrency TS|"
 "`P2505R5 `__","LWG", "Monadic Functions for 
``std::expected``", "November 2022","|Complete|","17.0",""
 "`P2539R4 `__","LWG", "Should the output of 
``std::print`` to a terminal be synchronized with the underlying stream?", 
"November 2022","|In Progress|","","|format|"
-"`P2602R2 `__","LWG", "Poison Pills are Too Toxic", 
"November 2022","","","|ranges|"
+"`P2602R2 `__","LWG", "Poison Pills are Too Toxic", 
"November 2022","|Complete|","18.0","|ranges|"
 "`P2708R1 `__","LWG", "No Further Fundamentals 
TSes", "November 2022","|Nothing to do|","",""
 "","","","","","",""
 "`P0290R4 `__","LWG", "``apply()`` for 
``synchronized_value``","February 2023","","","|concurrency TS|"
diff --git a/libcxx/include/__compare/partial_order.h 
b/libcxx/include/__compare/partial_order.h
index 36a11dfaa2881b..b422bdd4ef8415 100644
--- a/libcxx/include/__compare/partial_order.h
+++ b/libcxx/include/__compare/partial_order.h
@@ -28,6 +28,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 // [cmp.alg]
 namespace __partial_order {
+void partial_order() = delete;
+
 struct __fn {
 // NOLINTBEGIN(libcpp-robust-against-adl) partial_order should use ADL, 
but only here
 template
diff --git a/libcxx/include/__compare/strong_order.h 
b/libcxx/include/__compare/strong_order.h
index cbfcf7316de9e0..ba59cb51b86d99 100644
--- a/libcxx/incl

[clang] [libcxx] [clang-tools-extra] [llvm] [libc++] P2602R2 Poison Pills are Too Toxic (PR #74534)

2024-01-10 Thread Jakub Mazurkiewicz via cfe-commits

https://github.com/JMazurkiewicz updated 
https://github.com/llvm/llvm-project/pull/74534

>From aaccb9e13618517803df1230741b02b4c5ee08c7 Mon Sep 17 00:00:00 2001
From: Jakub Mazurkiewicz 
Date: Tue, 5 Dec 2023 23:36:57 +0100
Subject: [PATCH 1/3] [libc++] P2602R2 Poison Pills are Too Toxic

---
 libcxx/docs/FeatureTestMacroTable.rst |  2 +-
 libcxx/docs/Status/Cxx23Papers.csv|  2 +-
 libcxx/include/__compare/partial_order.h  |  2 ++
 libcxx/include/__compare/strong_order.h   |  2 ++
 libcxx/include/__compare/weak_order.h |  2 ++
 libcxx/include/__iterator/iter_move.h |  2 +-
 libcxx/include/__ranges/access.h  |  6 ++--
 libcxx/include/__ranges/rbegin.h  |  3 +-
 libcxx/include/__ranges/rend.h|  3 +-
 libcxx/include/__ranges/size.h|  3 +-
 libcxx/include/version|  4 +--
 .../iterator.cust.move/iter_move.pass.cpp | 11 +++
 .../iterator.cust.swap/iter_swap.pass.cpp |  6 
 .../ordinary_unqualified_lookup_helpers.h | 33 +++
 .../cmp/cmp.alg/partial_order.pass.cpp|  9 +
 .../cmp/cmp.alg/strong_order.pass.cpp |  9 +
 .../cmp/cmp.alg/weak_order.pass.cpp   |  9 +
 .../algorithm.version.compile.pass.cpp| 14 
 .../functional.version.compile.pass.cpp   | 14 
 .../iterator.version.compile.pass.cpp | 14 
 .../memory.version.compile.pass.cpp   | 14 
 .../ranges.version.compile.pass.cpp   | 14 
 .../version.version.compile.pass.cpp  | 14 
 .../std/ranges/range.access/begin.pass.cpp| 18 +++---
 .../test/std/ranges/range.access/end.pass.cpp | 20 +++
 .../ordinary_unqualified_lookup_helpers.h | 25 ++
 .../std/ranges/range.access/rbegin.pass.cpp   | 18 +++---
 .../std/ranges/range.access/rend.pass.cpp | 20 +++
 .../std/ranges/range.access/size.pass.cpp |  9 -
 .../generate_feature_test_macro_components.py |  2 +-
 30 files changed, 223 insertions(+), 81 deletions(-)
 create mode 100644 
libcxx/test/std/language.support/cmp/cmp.alg/ordinary_unqualified_lookup_helpers.h
 create mode 100644 
libcxx/test/std/ranges/range.access/ordinary_unqualified_lookup_helpers.h

diff --git a/libcxx/docs/FeatureTestMacroTable.rst 
b/libcxx/docs/FeatureTestMacroTable.rst
index d09f65b7cadc0e..f4788aa5747882 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -266,7 +266,7 @@ Status
 --- -
 ``__cpp_lib_polymorphic_allocator`` ``201902L``
 --- -
-``__cpp_lib_ranges````202207L``
+``__cpp_lib_ranges````202211L``
 --- -
 ``__cpp_lib_remove_cvref``  ``201711L``
 --- -
diff --git a/libcxx/docs/Status/Cxx23Papers.csv 
b/libcxx/docs/Status/Cxx23Papers.csv
index e03cbff2a08bbf..7dc6f36ba1e63f 100644
--- a/libcxx/docs/Status/Cxx23Papers.csv
+++ b/libcxx/docs/Status/Cxx23Papers.csv
@@ -100,7 +100,7 @@
 "`P2396R1 `__","LWG", "Concurrency TS 2 fixes ", 
"November 2022","","","|concurrency TS|"
 "`P2505R5 `__","LWG", "Monadic Functions for 
``std::expected``", "November 2022","|Complete|","17.0",""
 "`P2539R4 `__","LWG", "Should the output of 
``std::print`` to a terminal be synchronized with the underlying stream?", 
"November 2022","|In Progress|","","|format|"
-"`P2602R2 `__","LWG", "Poison Pills are Too Toxic", 
"November 2022","","","|ranges|"
+"`P2602R2 `__","LWG", "Poison Pills are Too Toxic", 
"November 2022","|Complete|","18.0","|ranges|"
 "`P2708R1 `__","LWG", "No Further Fundamentals 
TSes", "November 2022","|Nothing to do|","",""
 "","","","","","",""
 "`P0290R4 `__","LWG", "``apply()`` for 
``synchronized_value``","February 2023","","","|concurrency TS|"
diff --git a/libcxx/include/__compare/partial_order.h 
b/libcxx/include/__compare/partial_order.h
index 36a11dfaa2881b..b422bdd4ef8415 100644
--- a/libcxx/include/__compare/partial_order.h
+++ b/libcxx/include/__compare/partial_order.h
@@ -28,6 +28,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 // [cmp.alg]
 namespace __partial_order {
+void partial_order() = delete;
+
 struct __fn {
 // NOLINTBEGIN(libcpp-robust-against-adl) partial_order should use ADL, 
but only here
 template
diff --git a/libcxx/include/__compare/strong_order.h 
b/libcxx/include/__compare/strong_order.h
index cbfcf7316de9e0..ba59cb51b86d99 100644
--- a/libcxx/incl

[clang] [libcxx] [clang-tools-extra] [llvm] [libc++] P2602R2 Poison Pills are Too Toxic (PR #74534)

2024-01-10 Thread Jakub Mazurkiewicz via cfe-commits

https://github.com/JMazurkiewicz updated 
https://github.com/llvm/llvm-project/pull/74534

>From aaccb9e13618517803df1230741b02b4c5ee08c7 Mon Sep 17 00:00:00 2001
From: Jakub Mazurkiewicz 
Date: Tue, 5 Dec 2023 23:36:57 +0100
Subject: [PATCH 1/4] [libc++] P2602R2 Poison Pills are Too Toxic

---
 libcxx/docs/FeatureTestMacroTable.rst |  2 +-
 libcxx/docs/Status/Cxx23Papers.csv|  2 +-
 libcxx/include/__compare/partial_order.h  |  2 ++
 libcxx/include/__compare/strong_order.h   |  2 ++
 libcxx/include/__compare/weak_order.h |  2 ++
 libcxx/include/__iterator/iter_move.h |  2 +-
 libcxx/include/__ranges/access.h  |  6 ++--
 libcxx/include/__ranges/rbegin.h  |  3 +-
 libcxx/include/__ranges/rend.h|  3 +-
 libcxx/include/__ranges/size.h|  3 +-
 libcxx/include/version|  4 +--
 .../iterator.cust.move/iter_move.pass.cpp | 11 +++
 .../iterator.cust.swap/iter_swap.pass.cpp |  6 
 .../ordinary_unqualified_lookup_helpers.h | 33 +++
 .../cmp/cmp.alg/partial_order.pass.cpp|  9 +
 .../cmp/cmp.alg/strong_order.pass.cpp |  9 +
 .../cmp/cmp.alg/weak_order.pass.cpp   |  9 +
 .../algorithm.version.compile.pass.cpp| 14 
 .../functional.version.compile.pass.cpp   | 14 
 .../iterator.version.compile.pass.cpp | 14 
 .../memory.version.compile.pass.cpp   | 14 
 .../ranges.version.compile.pass.cpp   | 14 
 .../version.version.compile.pass.cpp  | 14 
 .../std/ranges/range.access/begin.pass.cpp| 18 +++---
 .../test/std/ranges/range.access/end.pass.cpp | 20 +++
 .../ordinary_unqualified_lookup_helpers.h | 25 ++
 .../std/ranges/range.access/rbegin.pass.cpp   | 18 +++---
 .../std/ranges/range.access/rend.pass.cpp | 20 +++
 .../std/ranges/range.access/size.pass.cpp |  9 -
 .../generate_feature_test_macro_components.py |  2 +-
 30 files changed, 223 insertions(+), 81 deletions(-)
 create mode 100644 
libcxx/test/std/language.support/cmp/cmp.alg/ordinary_unqualified_lookup_helpers.h
 create mode 100644 
libcxx/test/std/ranges/range.access/ordinary_unqualified_lookup_helpers.h

diff --git a/libcxx/docs/FeatureTestMacroTable.rst 
b/libcxx/docs/FeatureTestMacroTable.rst
index d09f65b7cadc0e..f4788aa5747882 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -266,7 +266,7 @@ Status
 --- -
 ``__cpp_lib_polymorphic_allocator`` ``201902L``
 --- -
-``__cpp_lib_ranges````202207L``
+``__cpp_lib_ranges````202211L``
 --- -
 ``__cpp_lib_remove_cvref``  ``201711L``
 --- -
diff --git a/libcxx/docs/Status/Cxx23Papers.csv 
b/libcxx/docs/Status/Cxx23Papers.csv
index e03cbff2a08bbf..7dc6f36ba1e63f 100644
--- a/libcxx/docs/Status/Cxx23Papers.csv
+++ b/libcxx/docs/Status/Cxx23Papers.csv
@@ -100,7 +100,7 @@
 "`P2396R1 `__","LWG", "Concurrency TS 2 fixes ", 
"November 2022","","","|concurrency TS|"
 "`P2505R5 `__","LWG", "Monadic Functions for 
``std::expected``", "November 2022","|Complete|","17.0",""
 "`P2539R4 `__","LWG", "Should the output of 
``std::print`` to a terminal be synchronized with the underlying stream?", 
"November 2022","|In Progress|","","|format|"
-"`P2602R2 `__","LWG", "Poison Pills are Too Toxic", 
"November 2022","","","|ranges|"
+"`P2602R2 `__","LWG", "Poison Pills are Too Toxic", 
"November 2022","|Complete|","18.0","|ranges|"
 "`P2708R1 `__","LWG", "No Further Fundamentals 
TSes", "November 2022","|Nothing to do|","",""
 "","","","","","",""
 "`P0290R4 `__","LWG", "``apply()`` for 
``synchronized_value``","February 2023","","","|concurrency TS|"
diff --git a/libcxx/include/__compare/partial_order.h 
b/libcxx/include/__compare/partial_order.h
index 36a11dfaa2881b..b422bdd4ef8415 100644
--- a/libcxx/include/__compare/partial_order.h
+++ b/libcxx/include/__compare/partial_order.h
@@ -28,6 +28,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 // [cmp.alg]
 namespace __partial_order {
+void partial_order() = delete;
+
 struct __fn {
 // NOLINTBEGIN(libcpp-robust-against-adl) partial_order should use ADL, 
but only here
 template
diff --git a/libcxx/include/__compare/strong_order.h 
b/libcxx/include/__compare/strong_order.h
index cbfcf7316de9e0..ba59cb51b86d99 100644
--- a/libcxx/incl

[libcxx] [llvm] [clang] [clang-tools-extra] [libc++] P2602R2 Poison Pills are Too Toxic (PR #74534)

2024-02-03 Thread Jakub Mazurkiewicz via cfe-commits

https://github.com/JMazurkiewicz updated 
https://github.com/llvm/llvm-project/pull/74534

>From aaccb9e13618517803df1230741b02b4c5ee08c7 Mon Sep 17 00:00:00 2001
From: Jakub Mazurkiewicz 
Date: Tue, 5 Dec 2023 23:36:57 +0100
Subject: [PATCH 1/5] [libc++] P2602R2 Poison Pills are Too Toxic

---
 libcxx/docs/FeatureTestMacroTable.rst |  2 +-
 libcxx/docs/Status/Cxx23Papers.csv|  2 +-
 libcxx/include/__compare/partial_order.h  |  2 ++
 libcxx/include/__compare/strong_order.h   |  2 ++
 libcxx/include/__compare/weak_order.h |  2 ++
 libcxx/include/__iterator/iter_move.h |  2 +-
 libcxx/include/__ranges/access.h  |  6 ++--
 libcxx/include/__ranges/rbegin.h  |  3 +-
 libcxx/include/__ranges/rend.h|  3 +-
 libcxx/include/__ranges/size.h|  3 +-
 libcxx/include/version|  4 +--
 .../iterator.cust.move/iter_move.pass.cpp | 11 +++
 .../iterator.cust.swap/iter_swap.pass.cpp |  6 
 .../ordinary_unqualified_lookup_helpers.h | 33 +++
 .../cmp/cmp.alg/partial_order.pass.cpp|  9 +
 .../cmp/cmp.alg/strong_order.pass.cpp |  9 +
 .../cmp/cmp.alg/weak_order.pass.cpp   |  9 +
 .../algorithm.version.compile.pass.cpp| 14 
 .../functional.version.compile.pass.cpp   | 14 
 .../iterator.version.compile.pass.cpp | 14 
 .../memory.version.compile.pass.cpp   | 14 
 .../ranges.version.compile.pass.cpp   | 14 
 .../version.version.compile.pass.cpp  | 14 
 .../std/ranges/range.access/begin.pass.cpp| 18 +++---
 .../test/std/ranges/range.access/end.pass.cpp | 20 +++
 .../ordinary_unqualified_lookup_helpers.h | 25 ++
 .../std/ranges/range.access/rbegin.pass.cpp   | 18 +++---
 .../std/ranges/range.access/rend.pass.cpp | 20 +++
 .../std/ranges/range.access/size.pass.cpp |  9 -
 .../generate_feature_test_macro_components.py |  2 +-
 30 files changed, 223 insertions(+), 81 deletions(-)
 create mode 100644 
libcxx/test/std/language.support/cmp/cmp.alg/ordinary_unqualified_lookup_helpers.h
 create mode 100644 
libcxx/test/std/ranges/range.access/ordinary_unqualified_lookup_helpers.h

diff --git a/libcxx/docs/FeatureTestMacroTable.rst 
b/libcxx/docs/FeatureTestMacroTable.rst
index d09f65b7cadc0..f4788aa574788 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -266,7 +266,7 @@ Status
 --- -
 ``__cpp_lib_polymorphic_allocator`` ``201902L``
 --- -
-``__cpp_lib_ranges````202207L``
+``__cpp_lib_ranges````202211L``
 --- -
 ``__cpp_lib_remove_cvref``  ``201711L``
 --- -
diff --git a/libcxx/docs/Status/Cxx23Papers.csv 
b/libcxx/docs/Status/Cxx23Papers.csv
index e03cbff2a08bb..7dc6f36ba1e63 100644
--- a/libcxx/docs/Status/Cxx23Papers.csv
+++ b/libcxx/docs/Status/Cxx23Papers.csv
@@ -100,7 +100,7 @@
 "`P2396R1 `__","LWG", "Concurrency TS 2 fixes ", 
"November 2022","","","|concurrency TS|"
 "`P2505R5 `__","LWG", "Monadic Functions for 
``std::expected``", "November 2022","|Complete|","17.0",""
 "`P2539R4 `__","LWG", "Should the output of 
``std::print`` to a terminal be synchronized with the underlying stream?", 
"November 2022","|In Progress|","","|format|"
-"`P2602R2 `__","LWG", "Poison Pills are Too Toxic", 
"November 2022","","","|ranges|"
+"`P2602R2 `__","LWG", "Poison Pills are Too Toxic", 
"November 2022","|Complete|","18.0","|ranges|"
 "`P2708R1 `__","LWG", "No Further Fundamentals 
TSes", "November 2022","|Nothing to do|","",""
 "","","","","","",""
 "`P0290R4 `__","LWG", "``apply()`` for 
``synchronized_value``","February 2023","","","|concurrency TS|"
diff --git a/libcxx/include/__compare/partial_order.h 
b/libcxx/include/__compare/partial_order.h
index 36a11dfaa2881..b422bdd4ef841 100644
--- a/libcxx/include/__compare/partial_order.h
+++ b/libcxx/include/__compare/partial_order.h
@@ -28,6 +28,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 // [cmp.alg]
 namespace __partial_order {
+void partial_order() = delete;
+
 struct __fn {
 // NOLINTBEGIN(libcpp-robust-against-adl) partial_order should use ADL, 
but only here
 template
diff --git a/libcxx/include/__compare/strong_order.h 
b/libcxx/include/__compare/strong_order.h
index cbfcf7316de9e..ba59cb51b86d9 100644
--- a/libcxx/include/__co

[clang-tools-extra] [clang] [libcxx] [libc++] Implement `views::join_with` (PR #65536)

2024-02-04 Thread Jakub Mazurkiewicz via cfe-commits

https://github.com/JMazurkiewicz ready_for_review 
https://github.com/llvm/llvm-project/pull/65536
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] [libc] [compiler-rt] [lld] [clang] [lldb] [llvm] [flang] [clang-tools-extra] [libc++] P2602R2 Poison Pills are Too Toxic (PR #74534)

2024-02-05 Thread Jakub Mazurkiewicz via cfe-commits

https://github.com/JMazurkiewicz updated 
https://github.com/llvm/llvm-project/pull/74534

>From aaccb9e13618517803df1230741b02b4c5ee08c7 Mon Sep 17 00:00:00 2001
From: Jakub Mazurkiewicz 
Date: Tue, 5 Dec 2023 23:36:57 +0100
Subject: [PATCH 1/6] [libc++] P2602R2 Poison Pills are Too Toxic

---
 libcxx/docs/FeatureTestMacroTable.rst |  2 +-
 libcxx/docs/Status/Cxx23Papers.csv|  2 +-
 libcxx/include/__compare/partial_order.h  |  2 ++
 libcxx/include/__compare/strong_order.h   |  2 ++
 libcxx/include/__compare/weak_order.h |  2 ++
 libcxx/include/__iterator/iter_move.h |  2 +-
 libcxx/include/__ranges/access.h  |  6 ++--
 libcxx/include/__ranges/rbegin.h  |  3 +-
 libcxx/include/__ranges/rend.h|  3 +-
 libcxx/include/__ranges/size.h|  3 +-
 libcxx/include/version|  4 +--
 .../iterator.cust.move/iter_move.pass.cpp | 11 +++
 .../iterator.cust.swap/iter_swap.pass.cpp |  6 
 .../ordinary_unqualified_lookup_helpers.h | 33 +++
 .../cmp/cmp.alg/partial_order.pass.cpp|  9 +
 .../cmp/cmp.alg/strong_order.pass.cpp |  9 +
 .../cmp/cmp.alg/weak_order.pass.cpp   |  9 +
 .../algorithm.version.compile.pass.cpp| 14 
 .../functional.version.compile.pass.cpp   | 14 
 .../iterator.version.compile.pass.cpp | 14 
 .../memory.version.compile.pass.cpp   | 14 
 .../ranges.version.compile.pass.cpp   | 14 
 .../version.version.compile.pass.cpp  | 14 
 .../std/ranges/range.access/begin.pass.cpp| 18 +++---
 .../test/std/ranges/range.access/end.pass.cpp | 20 +++
 .../ordinary_unqualified_lookup_helpers.h | 25 ++
 .../std/ranges/range.access/rbegin.pass.cpp   | 18 +++---
 .../std/ranges/range.access/rend.pass.cpp | 20 +++
 .../std/ranges/range.access/size.pass.cpp |  9 -
 .../generate_feature_test_macro_components.py |  2 +-
 30 files changed, 223 insertions(+), 81 deletions(-)
 create mode 100644 
libcxx/test/std/language.support/cmp/cmp.alg/ordinary_unqualified_lookup_helpers.h
 create mode 100644 
libcxx/test/std/ranges/range.access/ordinary_unqualified_lookup_helpers.h

diff --git a/libcxx/docs/FeatureTestMacroTable.rst 
b/libcxx/docs/FeatureTestMacroTable.rst
index d09f65b7cadc0..f4788aa574788 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -266,7 +266,7 @@ Status
 --- -
 ``__cpp_lib_polymorphic_allocator`` ``201902L``
 --- -
-``__cpp_lib_ranges````202207L``
+``__cpp_lib_ranges````202211L``
 --- -
 ``__cpp_lib_remove_cvref``  ``201711L``
 --- -
diff --git a/libcxx/docs/Status/Cxx23Papers.csv 
b/libcxx/docs/Status/Cxx23Papers.csv
index e03cbff2a08bb..7dc6f36ba1e63 100644
--- a/libcxx/docs/Status/Cxx23Papers.csv
+++ b/libcxx/docs/Status/Cxx23Papers.csv
@@ -100,7 +100,7 @@
 "`P2396R1 `__","LWG", "Concurrency TS 2 fixes ", 
"November 2022","","","|concurrency TS|"
 "`P2505R5 `__","LWG", "Monadic Functions for 
``std::expected``", "November 2022","|Complete|","17.0",""
 "`P2539R4 `__","LWG", "Should the output of 
``std::print`` to a terminal be synchronized with the underlying stream?", 
"November 2022","|In Progress|","","|format|"
-"`P2602R2 `__","LWG", "Poison Pills are Too Toxic", 
"November 2022","","","|ranges|"
+"`P2602R2 `__","LWG", "Poison Pills are Too Toxic", 
"November 2022","|Complete|","18.0","|ranges|"
 "`P2708R1 `__","LWG", "No Further Fundamentals 
TSes", "November 2022","|Nothing to do|","",""
 "","","","","","",""
 "`P0290R4 `__","LWG", "``apply()`` for 
``synchronized_value``","February 2023","","","|concurrency TS|"
diff --git a/libcxx/include/__compare/partial_order.h 
b/libcxx/include/__compare/partial_order.h
index 36a11dfaa2881..b422bdd4ef841 100644
--- a/libcxx/include/__compare/partial_order.h
+++ b/libcxx/include/__compare/partial_order.h
@@ -28,6 +28,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 // [cmp.alg]
 namespace __partial_order {
+void partial_order() = delete;
+
 struct __fn {
 // NOLINTBEGIN(libcpp-robust-against-adl) partial_order should use ADL, 
but only here
 template
diff --git a/libcxx/include/__compare/strong_order.h 
b/libcxx/include/__compare/strong_order.h
index cbfcf7316de9e..ba59cb51b86d9 100644
--- a/libcxx/include/__co

[clang] [libc++] P2770R0: "Stashing stashing iterators for proper flattening" (PR #66033)

2023-09-26 Thread Jakub Mazurkiewicz via cfe-commits

https://github.com/JMazurkiewicz updated 
https://github.com/llvm/llvm-project/pull/66033

>From bf7096f8f435268fd830c27056e2f24564f4356b Mon Sep 17 00:00:00 2001
From: Jakub Mazurkiewicz 
Date: Fri, 8 Sep 2023 18:20:59 +0200
Subject: [PATCH 1/5] [libc++] P2770R0: "Stashing stashing iterators for proper
 flattening"

* Parially implements P2770R0: "Stashing stashing iterators for proper 
flattening"
* `join_with_view` hasn't been done yet since this type isn't implemented yet
* Rename `test/libcxx/ranges/range.adaptors/range.adaptor.tuple` directory to 
`test/libcxx/ranges/range.adaptors/range.adaptor.helpers` to match the 
standard: http://eel.is/c++draft/range.adaptor.helpers (this change happened in 
P2770R0, see point 3 of wording).
* Rename `libcxx\test\std\ranges\range.adaptors\range.join.view` to 
`libcxx\test\std\ranges\range.adaptors\range.join` to match the standard
---
 libcxx/docs/Status/Cxx23.rst  |   1 +
 libcxx/docs/Status/Cxx23Papers.csv|   2 +-
 libcxx/docs/Status/RangesMajorFeatures.csv|   1 +
 libcxx/docs/Status/RangesViews.csv|   2 +-
 libcxx/include/CMakeLists.txt |   1 +
 libcxx/include/__ranges/helpers.h |  39 ++
 libcxx/include/__ranges/join_view.h   | 131 +++---
 libcxx/include/module.modulemap.in|   1 +
 libcxx/include/ranges |   1 +
 libcxx/include/regex  |   8 ++
 libcxx/modules/std/ranges.inc |   2 -
 .../as-lvalue.verify.cpp  |  47 +++
 .../tuple-for-each.pass.cpp   |   0
 .../segmented_iterator.compile.pass.cpp   |   1 -
 .../alg.copy/ranges.copy.segmented.pass.cpp   |   2 -
 .../alg.copy/ranges.copy_backward.pass.cpp|   2 -
 .../iterator/ctor.parent.outer.pass.cpp   |  57 
 .../adaptor.pass.cpp  |   1 -
 .../base.pass.cpp |   1 -
 .../begin.pass.cpp|  31 -
 .../ctad.compile.pass.cpp |   1 -
 .../ctad.verify.cpp   |   1 -
 .../ctor.default.pass.cpp |   1 -
 .../ctor.view.pass.cpp|   1 -
 .../end.pass.cpp  |  22 +--
 .../general.pass.cpp  |   1 -
 .../iterator/arrow.pass.cpp   |   1 -
 .../iterator/ctor.default.pass.cpp|  16 +--
 .../iterator/ctor.other.pass.cpp  |   3 +-
 .../iterator/decrement.pass.cpp   |  21 ++-
 .../iterator/eq.pass.cpp  |   7 +-
 .../iterator/increment.pass.cpp   |  18 ++-
 .../iterator/iter.move.pass.cpp   |   1 -
 .../iterator/iter.swap.pass.cpp   |   1 -
 .../iterator/member_types.compile.pass.cpp|   1 -
 .../iterator/star.pass.cpp|   1 -
 .../sentinel/ctor.default.pass.cpp|   1 -
 .../sentinel/ctor.other.pass.cpp  |   1 -
 .../sentinel/ctor.parent.pass.cpp |   1 -
 .../sentinel/eq.pass.cpp  |  19 ++-
 .../{range.join.view => range.join}/types.h   |  66 -
 ...rator_concept_conformance.compile.pass.cpp |   4 +-
 .../std/re/re.iter/re.regiter/types.pass.cpp  |   4 +
 ...rator_concept_conformance.compile.pass.cpp |   4 +-
 .../std/re/re.iter/re.tokiter/types.pass.cpp  |   4 +
 45 files changed, 350 insertions(+), 182 deletions(-)
 create mode 100644 libcxx/include/__ranges/helpers.h
 create mode 100644 
libcxx/test/libcxx/ranges/range.adaptors/range.adaptor.helpers/as-lvalue.verify.cpp
 rename libcxx/test/libcxx/ranges/range.adaptors/{range.adaptor.tuple => 
range.adaptor.helpers}/tuple-for-each.pass.cpp (100%)
 delete mode 100644 
libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/ctor.parent.outer.pass.cpp
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/adaptor.pass.cpp (99%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/base.pass.cpp (98%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/begin.pass.cpp (83%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/ctad.compile.pass.cpp (98%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/ctad.verify.cpp (97%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/ctor.default.pass.cpp (97%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/ctor.view.pass.cpp (97%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/end.pass.cpp (95%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/general.pass.cpp (98%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/iterator/arrow.pass.cpp (99%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/iterato

[clang-tools-extra] [libc++] P2770R0: "Stashing stashing iterators for proper flattening" (PR #66033)

2023-09-27 Thread Jakub Mazurkiewicz via cfe-commits

https://github.com/JMazurkiewicz updated 
https://github.com/llvm/llvm-project/pull/66033

>From bf7096f8f435268fd830c27056e2f24564f4356b Mon Sep 17 00:00:00 2001
From: Jakub Mazurkiewicz 
Date: Fri, 8 Sep 2023 18:20:59 +0200
Subject: [PATCH 1/5] [libc++] P2770R0: "Stashing stashing iterators for proper
 flattening"

* Parially implements P2770R0: "Stashing stashing iterators for proper 
flattening"
* `join_with_view` hasn't been done yet since this type isn't implemented yet
* Rename `test/libcxx/ranges/range.adaptors/range.adaptor.tuple` directory to 
`test/libcxx/ranges/range.adaptors/range.adaptor.helpers` to match the 
standard: http://eel.is/c++draft/range.adaptor.helpers (this change happened in 
P2770R0, see point 3 of wording).
* Rename `libcxx\test\std\ranges\range.adaptors\range.join.view` to 
`libcxx\test\std\ranges\range.adaptors\range.join` to match the standard
---
 libcxx/docs/Status/Cxx23.rst  |   1 +
 libcxx/docs/Status/Cxx23Papers.csv|   2 +-
 libcxx/docs/Status/RangesMajorFeatures.csv|   1 +
 libcxx/docs/Status/RangesViews.csv|   2 +-
 libcxx/include/CMakeLists.txt |   1 +
 libcxx/include/__ranges/helpers.h |  39 ++
 libcxx/include/__ranges/join_view.h   | 131 +++---
 libcxx/include/module.modulemap.in|   1 +
 libcxx/include/ranges |   1 +
 libcxx/include/regex  |   8 ++
 libcxx/modules/std/ranges.inc |   2 -
 .../as-lvalue.verify.cpp  |  47 +++
 .../tuple-for-each.pass.cpp   |   0
 .../segmented_iterator.compile.pass.cpp   |   1 -
 .../alg.copy/ranges.copy.segmented.pass.cpp   |   2 -
 .../alg.copy/ranges.copy_backward.pass.cpp|   2 -
 .../iterator/ctor.parent.outer.pass.cpp   |  57 
 .../adaptor.pass.cpp  |   1 -
 .../base.pass.cpp |   1 -
 .../begin.pass.cpp|  31 -
 .../ctad.compile.pass.cpp |   1 -
 .../ctad.verify.cpp   |   1 -
 .../ctor.default.pass.cpp |   1 -
 .../ctor.view.pass.cpp|   1 -
 .../end.pass.cpp  |  22 +--
 .../general.pass.cpp  |   1 -
 .../iterator/arrow.pass.cpp   |   1 -
 .../iterator/ctor.default.pass.cpp|  16 +--
 .../iterator/ctor.other.pass.cpp  |   3 +-
 .../iterator/decrement.pass.cpp   |  21 ++-
 .../iterator/eq.pass.cpp  |   7 +-
 .../iterator/increment.pass.cpp   |  18 ++-
 .../iterator/iter.move.pass.cpp   |   1 -
 .../iterator/iter.swap.pass.cpp   |   1 -
 .../iterator/member_types.compile.pass.cpp|   1 -
 .../iterator/star.pass.cpp|   1 -
 .../sentinel/ctor.default.pass.cpp|   1 -
 .../sentinel/ctor.other.pass.cpp  |   1 -
 .../sentinel/ctor.parent.pass.cpp |   1 -
 .../sentinel/eq.pass.cpp  |  19 ++-
 .../{range.join.view => range.join}/types.h   |  66 -
 ...rator_concept_conformance.compile.pass.cpp |   4 +-
 .../std/re/re.iter/re.regiter/types.pass.cpp  |   4 +
 ...rator_concept_conformance.compile.pass.cpp |   4 +-
 .../std/re/re.iter/re.tokiter/types.pass.cpp  |   4 +
 45 files changed, 350 insertions(+), 182 deletions(-)
 create mode 100644 libcxx/include/__ranges/helpers.h
 create mode 100644 
libcxx/test/libcxx/ranges/range.adaptors/range.adaptor.helpers/as-lvalue.verify.cpp
 rename libcxx/test/libcxx/ranges/range.adaptors/{range.adaptor.tuple => 
range.adaptor.helpers}/tuple-for-each.pass.cpp (100%)
 delete mode 100644 
libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/ctor.parent.outer.pass.cpp
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/adaptor.pass.cpp (99%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/base.pass.cpp (98%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/begin.pass.cpp (83%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/ctad.compile.pass.cpp (98%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/ctad.verify.cpp (97%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/ctor.default.pass.cpp (97%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/ctor.view.pass.cpp (97%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/end.pass.cpp (95%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/general.pass.cpp (98%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/iterator/arrow.pass.cpp (99%)
 rename libcxx/test/std/ranges/range.adaptors/{range.join.view => 
range.join}/iterato