diff options
| author | Björn Svensson <bjorn.a.svensson@est.tech> | 2026-02-12 15:49:45 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-12 22:49:45 +0800 |
| commit | abf036ba49c27f143ea4903f9e4e2a7435b4b4f1 (patch) | |
| tree | eed542cc8dd9f0af177f2bbbad6a42d0fd631d5d /lldb/source/Plugins/LanguageRuntime/CPlusPlus/VerboseTrapFrameRecognizer.cpp | |
| parent | 8a2255fc420621e7a4bfa4ebce50a58c0fb99cf5 (diff) | |
| download | llvm-main.zip llvm-main.tar.gz llvm-main.tar.bz2 | |
When the checker `readability-simplify-boolean-expr` is used on C23
code, where the `bool` type is provided but not `static_cast`, the fixer
suggests faulty code.
```
bool negative_condition_conditional_return_statement(int i) {
if (!(i == 0)) return false; else return true;
}
/xx/llvm-project/build/../clang-tools-extra/test/clang-tidy/checkers/readability/simplify-boolean-expr-c23.c:323:25: warning: redundant boolean literal in conditional return statement [readability-simplify-boolean-expr]
323 | if (!(i == 0)) return false; else return true;
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
| return static_cast<bool>(i == 0)
```
Let's skip the use of `static_cast` for C code where a cast is not
needed.
---------
Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
Diffstat (limited to 'lldb/source/Plugins/LanguageRuntime/CPlusPlus/VerboseTrapFrameRecognizer.cpp')
0 files changed, 0 insertions, 0 deletions
