[llvm] [ADT] Relax iterator constraints on all_equal (PR #106400)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 28 09:41:48 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 a3cd8d76deeea89a56875f2e2aced8afba13f441 9520c3c86a47d58d8d3de44bbca27571f3dad807 --extensions h,cpp -- llvm/include/llvm/ADT/STLExtras.h llvm/unittests/ADT/STLExtrasTest.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/unittests/ADT/STLExtrasTest.cpp b/llvm/unittests/ADT/STLExtrasTest.cpp
index 63cf0cadfb..6792f1d6f0 100644
--- a/llvm/unittests/ADT/STLExtrasTest.cpp
+++ b/llvm/unittests/ADT/STLExtrasTest.cpp
@@ -832,13 +832,14 @@ TEST(STLExtrasTest, AllEqual) {
EXPECT_FALSE(all_equal(V));
}
-// Test to verify that all_equal works with a container that does not
+// Test to verify that all_equal works with a container that does not
// model the random access iterator concept.
TEST(STLExtrasTest, AllEqualNonRandomAccess) {
std::list<int> V;
- static_assert(!std::is_convertible<std::iterator_traits<decltype(V)::iterator>::iterator_category,
- std::random_access_iterator_tag >::value);
-
+ static_assert(!std::is_convertible<
+ std::iterator_traits<decltype(V)::iterator>::iterator_category,
+ std::random_access_iterator_tag>::value);
+
EXPECT_TRUE(all_equal(V));
V.push_back(1);
@@ -851,7 +852,7 @@ TEST(STLExtrasTest, AllEqualNonRandomAccess) {
V.push_back(2);
EXPECT_FALSE(all_equal(V));
}
-
+
TEST(STLExtrasTest, AllEqualInitializerList) {
EXPECT_TRUE(all_equal({1}));
EXPECT_TRUE(all_equal({1, 1}));
``````````
</details>
https://github.com/llvm/llvm-project/pull/106400
More information about the llvm-commits
mailing list