[clang-tools-extra] [clang-tidy] Fix trailing semicolon and lost comment in readability-use-std-min-max (PR #208782)
Zeyi Xu via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 31 07:14:45 PDT 2026
================
@@ -253,6 +253,18 @@ void testVectorSizeType() {
value = v.size();
}
+namespace gh208708 {
+void f(int &n) {
+ // CHECK-MESSAGES: :[[@LINE+2]]:3: warning: use `std::max` instead of `<` [readability-use-std-min-max]
+ // CHECK-FIXES: n = std::max(n, -1);
+ if (n < -1) n = -1 ;
+
+ // CHECK-MESSAGES: :[[@LINE+2]]:3: warning: use `std::min` instead of `>` [readability-use-std-min-max]
----------------
zeyi2 wrote:
```suggestion
// CHECK-MESSAGES: :[[@LINE+2]]:3: warning: use `std::min` instead of `>`
```
https://github.com/llvm/llvm-project/pull/208782
More information about the cfe-commits
mailing list