[clang] [clang-tools-extra] [clang-tidy] Address false positives in misc-redundant-expression checker (PR #122841)
Piotr Zegar via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 20 07:31:49 PST 2025
================
@@ -847,11 +869,104 @@ static bool areExprsMacroAndNonMacro(const Expr *&LhsExpr,
if (!LhsExpr || !RhsExpr)
return false;
- SourceLocation LhsLoc = LhsExpr->getExprLoc();
- SourceLocation RhsLoc = RhsExpr->getExprLoc();
+ const SourceLocation LhsLoc = LhsExpr->getExprLoc();
+ const SourceLocation RhsLoc = RhsExpr->getExprLoc();
return LhsLoc.isMacroID() != RhsLoc.isMacroID();
}
+
+static bool areStringsSameIgnoreSpaces(const llvm::StringRef *Left,
----------------
PiotrZSL wrote:
ptr to llvm::StringRef is a bad habit, pass it by value
https://github.com/llvm/llvm-project/pull/122841
More information about the cfe-commits
mailing list