================
@@ -174,11 +174,20 @@ bool bad_any_of7() {
   return false;
 }
 
+bool good_none_of() {
+  int v[] = {1, 2, 3};
+  // CHECK-MESSAGES: :[[@LINE+1]]:3: warning: replace loop by 'std::none_of()' 
[readability-use-anyofallof]
+  for (int i : v)
+    if (i)
+      return false;
+  return true;
+}
----------------
vbvictor wrote:

Could we add test with other statements in loop like in
```
bool good_any_of_throw() {
  int v[] = {1, 2, 3};
  for (int i : v) {
    // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: replace loop by 'std::any_of()'
    if (i > 3)
      return true;
    if (i == 42)
      throw 0;
  }

  return false;
}
```

https://github.com/llvm/llvm-project/pull/182065
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to