[libcxx-commits] [libcxx] [libc++] Disallow std::prev(non_cpp17_bidi_iterator) (PR #112102)

via libcxx-commits libcxx-commits at lists.llvm.org
Sat Oct 12 10:28:25 PDT 2024


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 51a2f50ee76a52d4a542822bfda9c4c17904b72f 6cd8e5c2031bffab574b62e63bb8e7a7befe4779 --extensions cpp,h -- libcxx/include/__iterator/prev.h libcxx/test/std/iterators/iterator.primitives/iterator.operations/prev.pass.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libcxx/test/std/iterators/iterator.primitives/iterator.operations/prev.pass.cpp b/libcxx/test/std/iterators/iterator.primitives/iterator.operations/prev.pass.cpp
index be0295d4f7..97b9aee704 100644
--- a/libcxx/test/std/iterators/iterator.primitives/iterator.operations/prev.pass.cpp
+++ b/libcxx/test/std/iterators/iterator.primitives/iterator.operations/prev.pass.cpp
@@ -22,7 +22,7 @@ template <class Iter>
 std::false_type prev_test(...);
 
 template <class Iter>
-decltype((void) std::prev(std::declval<Iter>()), std::true_type()) prev_test(int);
+decltype((void)std::prev(std::declval<Iter>()), std::true_type()) prev_test(int);
 
 template <class Iter>
 using CanPrev = decltype(prev_test<Iter>(0));
@@ -30,7 +30,7 @@ using CanPrev = decltype(prev_test<Iter>(0));
 static_assert(!CanPrev<cpp17_input_iterator<int*> >::value, "");
 static_assert(CanPrev<bidirectional_iterator<int*> >::value, "");
 #if TEST_STD_VER >= 20
-    static_assert(!CanPrev<cpp20_random_access_iterator<int*> >::value);
+static_assert(!CanPrev<cpp20_random_access_iterator<int*> >::value);
 #endif
 
 template <class It>

``````````

</details>


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


More information about the libcxx-commits mailing list