[libcxx-commits] [libcxx] WIP [libc++][ranges] Applied [[nodiscard]] to `lazy_split` (PR #208036)

Lucas Mellone via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jul 8 07:32:38 PDT 2026


https://github.com/lknknm updated https://github.com/llvm/llvm-project/pull/208036

>From 1a1da3d615018ef52c9eefcbb376679f5cdd7505 Mon Sep 17 00:00:00 2001
From: Lucas Mellone <github.snugness349 at passinbox.com>
Date: Tue, 7 Jul 2026 18:00:56 +0200
Subject: [PATCH 1/7] initial: nodiscard implementation to lazy_split_view.h

---
 libcxx/include/__ranges/lazy_split_view.h | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/libcxx/include/__ranges/lazy_split_view.h b/libcxx/include/__ranges/lazy_split_view.h
index 938dca24cc4fc..01d398a0ac6d8 100644
--- a/libcxx/include/__ranges/lazy_split_view.h
+++ b/libcxx/include/__ranges/lazy_split_view.h
@@ -95,14 +95,14 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
   _LIBCPP_HIDE_FROM_ABI constexpr explicit lazy_split_view(_Range&& __r, range_value_t<_Range> __e)
       : __base_(views::all(std::forward<_Range>(__r))), __pattern_(views::single(std::move(__e))) {}
 
-  _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
+  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() const&
     requires copy_constructible<_View>
   {
     return __base_;
   }
-  _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }
+  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr auto begin() {
+  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() {
     if constexpr (forward_range<_View>) {
       return __outer_iterator < __simple_view<_View> && __simple_view < _Pattern >> {*this, ranges::begin(__base_)};
     } else {
@@ -111,19 +111,19 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
     }
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const
+  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const
     requires forward_range<_View> && forward_range<const _View>
   {
     return __outer_iterator<true>{*this, ranges::begin(__base_)};
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr auto end()
+  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end()
     requires forward_range<_View> && common_range<_View>
   {
     return __outer_iterator < __simple_view<_View> && __simple_view < _Pattern >> {*this, ranges::end(__base_)};
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr auto end() const {
+  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() const {
     if constexpr (forward_range<_View> && forward_range<const _View> && common_range<const _View>) {
       return __outer_iterator<true>{*this, ranges::end(__base_)};
     } else {
@@ -206,7 +206,7 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
       requires _Const && convertible_to<iterator_t<_View>, iterator_t<_Base>>
         : __parent_(__i.__parent_), __current_(std::move(__i.__current_)) {}
 
-    _LIBCPP_HIDE_FROM_ABI constexpr value_type operator*() const { return value_type{*this}; }
+    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr value_type operator*() const { return value_type{*this}; }
 
     _LIBCPP_HIDE_FROM_ABI constexpr __outer_iterator& operator++() {
       const auto __end = ranges::end(__parent_->__base_);
@@ -342,14 +342,14 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
 
     _LIBCPP_HIDE_FROM_ABI constexpr explicit __inner_iterator(__outer_iterator<_Const> __i) : __i_(std::move(__i)) {}
 
-    _LIBCPP_HIDE_FROM_ABI constexpr const iterator_t<_Base>& base() const& noexcept { return __i_.__current(); }
-    _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_Base> base() &&
+    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const iterator_t<_Base>& base() const& noexcept { return __i_.__current(); }
+    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_Base> base() &&
       requires forward_range<_View>
     {
       return std::move(__i_.__current());
     }
 
-    _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() const { return *__i_.__current(); }
+    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() const { return *__i_.__current(); }
 
     _LIBCPP_HIDE_FROM_ABI constexpr __inner_iterator& operator++() {
       __incremented_ = true;
@@ -385,7 +385,7 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
       return __x.__is_done();
     }
 
-    _LIBCPP_HIDE_FROM_ABI friend constexpr decltype(auto)
+    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr decltype(auto)
     iter_move(const __inner_iterator& __i) noexcept(noexcept(ranges::iter_move(__i.__outer_current()))) {
       return ranges::iter_move(__i.__outer_current());
     }

>From 845a2090e07f251f9a46f849f149d5662ecdbc45 Mon Sep 17 00:00:00 2001
From: Lucas Mellone <github.snugness349 at passinbox.com>
Date: Tue, 7 Jul 2026 22:49:19 +0200
Subject: [PATCH 2/7] add: initial tests and clang-format fix

---
 libcxx/include/__ranges/lazy_split_view.h     | 12 +++++----
 .../range.lazy.split/nodiscard.verify.cpp     | 27 +++++++++++++++++++
 2 files changed, 34 insertions(+), 5 deletions(-)
 create mode 100644 libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/nodiscard.verify.cpp

diff --git a/libcxx/include/__ranges/lazy_split_view.h b/libcxx/include/__ranges/lazy_split_view.h
index 01d398a0ac6d8..5e336cbfcac49 100644
--- a/libcxx/include/__ranges/lazy_split_view.h
+++ b/libcxx/include/__ranges/lazy_split_view.h
@@ -104,7 +104,7 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
 
   [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() {
     if constexpr (forward_range<_View>) {
-      return __outer_iterator < __simple_view<_View> && __simple_view < _Pattern >> {*this, ranges::begin(__base_)};
+      return __outer_iterator< __simple_view<_View> && __simple_view< _Pattern >>{*this, ranges::begin(__base_)};
     } else {
       __current_.__emplace(ranges::begin(__base_));
       return __outer_iterator<false>{*this};
@@ -120,7 +120,7 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
   [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end()
     requires forward_range<_View> && common_range<_View>
   {
-    return __outer_iterator < __simple_view<_View> && __simple_view < _Pattern >> {*this, ranges::end(__base_)};
+    return __outer_iterator< __simple_view<_View> && __simple_view< _Pattern >>{*this, ranges::end(__base_)};
   }
 
   [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() const {
@@ -342,7 +342,9 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
 
     _LIBCPP_HIDE_FROM_ABI constexpr explicit __inner_iterator(__outer_iterator<_Const> __i) : __i_(std::move(__i)) {}
 
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const iterator_t<_Base>& base() const& noexcept { return __i_.__current(); }
+    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const iterator_t<_Base>& base() const& noexcept {
+      return __i_.__current();
+    }
     [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_Base> base() &&
       requires forward_range<_View>
     {
@@ -404,8 +406,8 @@ template <class _Range, class _Pattern>
 lazy_split_view(_Range&&, _Pattern&&) -> lazy_split_view<views::all_t<_Range>, views::all_t<_Pattern>>;
 
 template <input_range _Range>
-lazy_split_view(_Range&&,
-                range_value_t<_Range>) -> lazy_split_view<views::all_t<_Range>, single_view<range_value_t<_Range>>>;
+lazy_split_view(_Range&&, range_value_t<_Range>)
+    -> lazy_split_view<views::all_t<_Range>, single_view<range_value_t<_Range>>>;
 
 namespace views {
 namespace __lazy_split_view {
diff --git a/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/nodiscard.verify.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/nodiscard.verify.cpp
new file mode 100644
index 0000000000000..cd15b33b66d59
--- /dev/null
+++ b/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/nodiscard.verify.cpp
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: std-at-least-c++20
+
+// Check that functions are marked [[nodiscard]]
+
+#include <ranges>
+#include <utility>
+
+void test() {
+  // [range.lazy.split.overview]
+
+  std::string str = "the quick brown fox";
+  char pattern    = ' ';
+
+  // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+  std::views::split(str, pattern);
+
+  // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+  std::views::split(pattern);
+}

>From 054f55611b632030795527d777509c70609e5df0 Mon Sep 17 00:00:00 2001
From: Lucas Mellone <github.snugness349 at passinbox.com>
Date: Tue, 7 Jul 2026 22:57:55 +0200
Subject: [PATCH 3/7] fix: minor fixes for header include and lazy_split

---
 .../range.adaptors/range.lazy.split/nodiscard.verify.cpp  | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/nodiscard.verify.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/nodiscard.verify.cpp
index cd15b33b66d59..c6420b0adf5d5 100644
--- a/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/nodiscard.verify.cpp
+++ b/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/nodiscard.verify.cpp
@@ -11,17 +11,19 @@
 // Check that functions are marked [[nodiscard]]
 
 #include <ranges>
+#include <string>
 #include <utility>
 
 void test() {
   // [range.lazy.split.overview]
 
-  std::string str = "the quick brown fox";
+  std::string str { "the quick brown fox" };
   char pattern    = ' ';
 
   // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
-  std::views::split(str, pattern);
+  std::views::lazy_split(str, pattern);
 
   // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
-  std::views::split(pattern);
+  std::views::lazy_split(pattern);
+
 }

>From fbf22aa66f5d3205c82bbba057664780a8fbe057 Mon Sep 17 00:00:00 2001
From: Lucas Mellone <github.snugness349 at passinbox.com>
Date: Tue, 7 Jul 2026 23:32:22 +0200
Subject: [PATCH 4/7] add: test cases and remove nodiscard in implementation
 detail

---
 libcxx/include/__ranges/lazy_split_view.h     |  2 +-
 .../range.lazy.split/nodiscard.verify.cpp     | 41 ++++++++++++++++---
 2 files changed, 37 insertions(+), 6 deletions(-)

diff --git a/libcxx/include/__ranges/lazy_split_view.h b/libcxx/include/__ranges/lazy_split_view.h
index 5e336cbfcac49..66f18d5edad76 100644
--- a/libcxx/include/__ranges/lazy_split_view.h
+++ b/libcxx/include/__ranges/lazy_split_view.h
@@ -206,7 +206,7 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
       requires _Const && convertible_to<iterator_t<_View>, iterator_t<_Base>>
         : __parent_(__i.__parent_), __current_(std::move(__i.__current_)) {}
 
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr value_type operator*() const { return value_type{*this}; }
+    _LIBCPP_HIDE_FROM_ABI constexpr value_type operator*() const { return value_type{*this}; }
 
     _LIBCPP_HIDE_FROM_ABI constexpr __outer_iterator& operator++() {
       const auto __end = ranges::end(__parent_->__base_);
diff --git a/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/nodiscard.verify.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/nodiscard.verify.cpp
index c6420b0adf5d5..b80f6f00836b0 100644
--- a/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/nodiscard.verify.cpp
+++ b/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/nodiscard.verify.cpp
@@ -8,22 +8,53 @@
 
 // REQUIRES: std-at-least-c++20
 
-// Check that functions are marked [[nodiscard]]
+// Test the libc++ extension that std::ranges::lazy_split_view and std::views::lazy_split are marked as [[nodiscard]].
 
 #include <ranges>
 #include <string>
 #include <utility>
 
 void test() {
-  // [range.lazy.split.overview]
-
-  std::string str { "the quick brown fox" };
+  std::string str = "the quick brown fox";
   char pattern    = ' ';
 
+  auto v = std::views::lazy_split(str, pattern);
+
+  // [range.lazy.split.view]
+
+  // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+  v.base();
+  // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+  std::move(v).base();
+
+  // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+  v.begin();
+  // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+  std::as_const(v).begin();
+
+  // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+  v.end();
+  // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+  std::as_const(v).end();
+
+  // [range.lazy.split.iterator]
+
+  auto c_it = std::as_const(v).begin();
+
+  // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+  c_it.base();
+
+  // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+  *c_it;
+
+  // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+  iter_move(c_it);
+
+  // [range.lazy.split.overview]
+
   // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
   std::views::lazy_split(str, pattern);
 
   // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
   std::views::lazy_split(pattern);
-
 }

>From 997525b35d5e7a64e9db03541cfbc7acf934f1da Mon Sep 17 00:00:00 2001
From: Lucas Mellone <github.snugness349 at passinbox.com>
Date: Wed, 8 Jul 2026 12:01:40 +0200
Subject: [PATCH 5/7] revert: accidental format changes

---
 libcxx/include/__ranges/lazy_split_view.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libcxx/include/__ranges/lazy_split_view.h b/libcxx/include/__ranges/lazy_split_view.h
index 66f18d5edad76..c9a941abe7ff9 100644
--- a/libcxx/include/__ranges/lazy_split_view.h
+++ b/libcxx/include/__ranges/lazy_split_view.h
@@ -104,7 +104,7 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
 
   [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() {
     if constexpr (forward_range<_View>) {
-      return __outer_iterator< __simple_view<_View> && __simple_view< _Pattern >>{*this, ranges::begin(__base_)};
+      return __outer_iterator < __simple_view<_View> && __simple_view < _Pattern >>{*this, ranges::begin(__base_)};
     } else {
       __current_.__emplace(ranges::begin(__base_));
       return __outer_iterator<false>{*this};
@@ -120,7 +120,7 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
   [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end()
     requires forward_range<_View> && common_range<_View>
   {
-    return __outer_iterator< __simple_view<_View> && __simple_view< _Pattern >>{*this, ranges::end(__base_)};
+    return __outer_iterator < __simple_view<_View> && __simple_view < _Pattern >>{*this, ranges::end(__base_)};
   }
 
   [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() const {
@@ -406,8 +406,8 @@ template <class _Range, class _Pattern>
 lazy_split_view(_Range&&, _Pattern&&) -> lazy_split_view<views::all_t<_Range>, views::all_t<_Pattern>>;
 
 template <input_range _Range>
-lazy_split_view(_Range&&, range_value_t<_Range>)
-    -> lazy_split_view<views::all_t<_Range>, single_view<range_value_t<_Range>>>;
+lazy_split_view(_Range&&, 
+                range_value_t<_Range>) -> lazy_split_view<views::all_t<_Range>, single_view<range_value_t<_Range>>>;
 
 namespace views {
 namespace __lazy_split_view {

>From 598aacef1fcf0d98cce6e0fd4b1c7ef3ff8e64db Mon Sep 17 00:00:00 2001
From: Lucas Mellone <github.snugness349 at passinbox.com>
Date: Wed, 8 Jul 2026 12:02:50 +0200
Subject: [PATCH 6/7] revert: accidental format changes

---
 libcxx/include/__ranges/lazy_split_view.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libcxx/include/__ranges/lazy_split_view.h b/libcxx/include/__ranges/lazy_split_view.h
index c9a941abe7ff9..fc41f5c49523b 100644
--- a/libcxx/include/__ranges/lazy_split_view.h
+++ b/libcxx/include/__ranges/lazy_split_view.h
@@ -104,7 +104,7 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
 
   [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto begin() {
     if constexpr (forward_range<_View>) {
-      return __outer_iterator < __simple_view<_View> && __simple_view < _Pattern >>{*this, ranges::begin(__base_)};
+      return __outer_iterator < __simple_view<_View> && __simple_view < _Pattern >> {*this, ranges::begin(__base_)};
     } else {
       __current_.__emplace(ranges::begin(__base_));
       return __outer_iterator<false>{*this};
@@ -120,7 +120,7 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
   [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end()
     requires forward_range<_View> && common_range<_View>
   {
-    return __outer_iterator < __simple_view<_View> && __simple_view < _Pattern >>{*this, ranges::end(__base_)};
+    return __outer_iterator < __simple_view<_View> && __simple_view < _Pattern >> {*this, ranges::end(__base_)};
   }
 
   [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto end() const {
@@ -406,7 +406,7 @@ template <class _Range, class _Pattern>
 lazy_split_view(_Range&&, _Pattern&&) -> lazy_split_view<views::all_t<_Range>, views::all_t<_Pattern>>;
 
 template <input_range _Range>
-lazy_split_view(_Range&&, 
+lazy_split_view(_Range&&,
                 range_value_t<_Range>) -> lazy_split_view<views::all_t<_Range>, single_view<range_value_t<_Range>>>;
 
 namespace views {

>From f81b6437ddbec10579a87c58dca1286b63f10763 Mon Sep 17 00:00:00 2001
From: Lucas Mellone <github.snugness349 at passinbox.com>
Date: Wed, 8 Jul 2026 16:32:21 +0200
Subject: [PATCH 7/7] fix: __outer_iterator to __inner_iterator nodiscard
 testing

---
 libcxx/include/__ranges/lazy_split_view.h              |  2 +-
 .../range.lazy.split/nodiscard.verify.cpp              | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/libcxx/include/__ranges/lazy_split_view.h b/libcxx/include/__ranges/lazy_split_view.h
index fc41f5c49523b..c05c932d09703 100644
--- a/libcxx/include/__ranges/lazy_split_view.h
+++ b/libcxx/include/__ranges/lazy_split_view.h
@@ -206,7 +206,7 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
       requires _Const && convertible_to<iterator_t<_View>, iterator_t<_Base>>
         : __parent_(__i.__parent_), __current_(std::move(__i.__current_)) {}
 
-    _LIBCPP_HIDE_FROM_ABI constexpr value_type operator*() const { return value_type{*this}; }
+    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr value_type operator*() const { return value_type{*this}; }
 
     _LIBCPP_HIDE_FROM_ABI constexpr __outer_iterator& operator++() {
       const auto __end = ranges::end(__parent_->__base_);
diff --git a/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/nodiscard.verify.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/nodiscard.verify.cpp
index b80f6f00836b0..ab865c7c94b85 100644
--- a/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/nodiscard.verify.cpp
+++ b/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/nodiscard.verify.cpp
@@ -37,18 +37,18 @@ void test() {
   // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
   std::as_const(v).end();
 
-  // [range.lazy.split.iterator]
+  // [range.lazy.split.outer-iterator]
 
-  auto c_it = std::as_const(v).begin();
+  auto c_it = as_const(v).begin();
 
   // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
-  c_it.base();
+  (*c_it).begin().base();
 
   // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
-  *c_it;
+  (*c_it);
 
   // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
-  iter_move(c_it);
+  iter_move((*c_it).begin());
 
   // [range.lazy.split.overview]
 



More information about the libcxx-commits mailing list