aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-remarkutil/RemarkUtilHelpers.cpp
diff options
context:
space:
mode:
authorflovent <flbven@protonmail.com>2025-10-12 14:18:02 +0800
committerGitHub <noreply@github.com>2025-10-12 14:18:02 +0800
commit4d29460b43e7826300b396a1ff30e5069f42c56c (patch)
treef8fe42ccfb20ce785df8876dc2522b97a905fdc1 /llvm/tools/llvm-remarkutil/RemarkUtilHelpers.cpp
parenta5e30f835097d6b210bb7896e6a4dad77b5b4742 (diff)
downloadllvm-main.zip
llvm-main.tar.gz
llvm-main.tar.bz2
[clang-tidy] Correctly add parentheses in `readability-implicit-bool-conversion` (#162215)HEADmain
For `CompoundAssignOperator` in condition, there will be two layers of `ImplicitCastExpr`, for code: ``` int val = -1; while(val >>= 7) { } ``` While statement's AST: ``` WhileStmt <line:4:5, line:5:5> |-ImplicitCastExpr <line:4:11, col:18> 'bool' <IntegralToBoolean> | `-ImplicitCastExpr <col:11, col:18> 'int' <LValueToRValue> | `-CompoundAssignOperator <col:11, col:18> 'int' lvalue '>>=' ComputeLHSTy='int' ComputeResultTy='int' | |-DeclRefExpr <col:11> 'int' lvalue Var 0x20290cb8 'val' 'int' | `-IntegerLiteral <col:18> 'int' 7 `-CompoundStmt <col:21, line:5:5> ``` This is not taken into account by the check when determining whether brackets need to be added. Closes #161318.
Diffstat (limited to 'llvm/tools/llvm-remarkutil/RemarkUtilHelpers.cpp')
0 files changed, 0 insertions, 0 deletions