[clang-tools-extra] [clang-tidy][bugprone-posix-return] support integer literals as LHS (PR #109302)

via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 20 07:03:27 PDT 2024


================
@@ -61,23 +67,26 @@ void PosixReturnCheck::check(const MatchFinder::MatchResult &Result) {
   if (const auto *LessThanZeroOp =
           Result.Nodes.getNodeAs<BinaryOperator>("ltzop")) {
     SourceLocation OperatorLoc = LessThanZeroOp->getOperatorLoc();
+    char NewBinOp = LessThanZeroOp->getOpcode() == BinaryOperator::Opcode::BO_LT
----------------
EugeneZelenko wrote:

```suggestion
    const char NewBinOp = LessThanZeroOp->getOpcode() == BinaryOperator::Opcode::BO_LT
```

https://github.com/llvm/llvm-project/pull/109302


More information about the cfe-commits mailing list