Issue |
141252
|
Summary |
[clang-tidy] Check request: readability-use-std-clamp
|
Labels |
clang-tidy
|
Assignees |
|
Reporter |
denzor200
|
Needs a check that will do all the same as "readability-use-std-min-max" but for `std::clamp` instead of `std::min` or `std::max`.
BEFORE:
```
void foo() {
int a = 2, b = 3, c = 4;
if (a < b)
a = b;
if (a > c)
a = c;
}
```
AFTER:
```
void foo() {
int a = 2, b = 3, c = 4;
a = std::clamp(a, b, c);
}
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs