[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)
Bhuminjay Soni via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 26 08:38:42 PST 2024
11happy wrote:
```
if (isa<clang::ImplicitCastExpr>(S) && !found) {
const auto CastKind = cast<clang::ImplicitCastExpr>(S)->getCastKind();
if (isImplicitCastType(CastKind)) {
found = true;
const clang::ImplicitCastExpr *ImplicitCast =
cast<clang::ImplicitCastExpr>(S);
GlobalImplicitCastType = ImplicitCast->getType();
// Stop visiting children.
return false;
}
}
```
these two Ifs can be clubbed into single one , as suggested insome previous style suggestions, but I have kept them to ensure better readability. should I club them?
https://github.com/llvm/llvm-project/pull/77816
More information about the cfe-commits
mailing list