[clang-tools-extra] [clang-tidy] Improved readability-bool-conversion to be more consistent when using parentheses (PR #72068)
via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 12 13:11:04 PST 2023
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 4c3206c5d5dee9dc3c7ad32c09d57a7fc592bcea 54743ceec9845cdc450d5c163a293e73884a8df9 -- clang-tools-extra/clang-tidy/readability/ImplicitBoolConversionCheck.cpp clang-tools-extra/test/clang-tidy/checkers/readability/implicit-bool-conversion.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang-tools-extra/clang-tidy/readability/ImplicitBoolConversionCheck.cpp b/clang-tools-extra/clang-tidy/readability/ImplicitBoolConversionCheck.cpp
index 9e627d281e..f0fca30de3 100644
--- a/clang-tools-extra/clang-tidy/readability/ImplicitBoolConversionCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/ImplicitBoolConversionCheck.cpp
@@ -152,7 +152,8 @@ StringRef getEquivalentBoolLiteralForExpr(const Expr *Expression,
return "false";
}
- if (const auto *IntLit = dyn_cast<IntegerLiteral>(Expression->IgnoreParens())) {
+ if (const auto *IntLit =
+ dyn_cast<IntegerLiteral>(Expression->IgnoreParens())) {
return (IntLit->getValue() == 0) ? "false" : "true";
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/72068
More information about the cfe-commits
mailing list