[libcxx-commits] [libcxx] [libc++][ranges] Applied `[[nodiscard]]` to `iota_view` (PR #173612)
via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Dec 26 00:08:23 PST 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- libcxx/test/libcxx/ranges/range.factories/range.iota.view/nodiscard.verify.cpp libcxx/include/__ranges/iota_view.h --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libcxx/include/__ranges/iota_view.h b/libcxx/include/__ranges/iota_view.h
index 0ce157b86..6b2576ec6 100644
--- a/libcxx/include/__ranges/iota_view.h
+++ b/libcxx/include/__ranges/iota_view.h
@@ -259,7 +259,8 @@ class iota_view : public view_interface<iota_view<_Start, _BoundSentinel>> {
return __i;
}
- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type operator-(const __iterator& __x, const __iterator& __y)
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr difference_type
+ operator-(const __iterator& __x, const __iterator& __y)
requires __advanceable<_Start>
{
if constexpr (__integer_like<_Start>) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/173612
More information about the libcxx-commits
mailing list