[clang-tools-extra] [clang-tidy] Fix false positive in misc-redundant-expression with type aliases (PR #198085)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 14 04:55:56 PDT 2026


================
@@ -97,9 +98,46 @@ static bool areEquivalentExpr(const Expr *Left, const Expr *Right) {
       return false;
     return cast<DependentScopeDeclRefExpr>(Left)->getQualifier() ==
            cast<DependentScopeDeclRefExpr>(Right)->getQualifier();
-  case Stmt::DeclRefExprClass:
-    return cast<DeclRefExpr>(Left)->getDecl() ==
-           cast<DeclRefExpr>(Right)->getDecl();
+  case Stmt::DeclRefExprClass: {
+    const auto *L = cast<DeclRefExpr>(Left);
----------------
vbvictor wrote:

Please refactor into separate function similar to areEquivalentExpr

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


More information about the cfe-commits mailing list