[clang-tools-extra] [clang-tidy] Correcting issues in `readability-implicit-bool-conversion` on C23 (PR #92241)
Björn Svensson via cfe-commits
cfe-commits at lists.llvm.org
Thu May 16 14:04:45 PDT 2024
================
@@ -368,7 +368,8 @@ Changes in existing checks
- Improved :doc:`readability-implicit-bool-conversion
<clang-tidy/checks/readability/implicit-bool-conversion>` check to provide
valid fix suggestions for ``static_cast`` without a preceding space and
- fixed problem with duplicate parentheses in double implicit casts.
+ fixed problem with duplicate parentheses in double implicit casts. Corrected
+ the fix suggestions for C23 by using C-style casts instead of ``static_cast``.
----------------
bjosv wrote:
The checker should only affect C23 (+later) of all C standards since the checker has
```
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
return LangOpts.Bool;
}
```
C23 is the first C standard with the bool keyword, instead of provided via macros, and my understanding is that's what LangOpts.Bool indicates.
https://github.com/llvm/llvm-project/pull/92241
More information about the cfe-commits
mailing list