================
@@ -84,13 +84,22 @@ class DerefFuncDeleteExprVisitor
     E = E->IgnoreParenCasts();
     if (auto *TempE = dyn_cast<CXXBindTemporaryExpr>(E))
       E = TempE->getSubExpr();
+    E = E->IgnoreParenCasts();
+    if (auto *Ref = dyn_cast<DeclRefExpr>(E)) {
+      if (auto *Decl = Ref->getDecl()) {
+        if (auto *VD = dyn_cast<VarDecl>(Decl))
----------------
haoNoQ wrote:

You can combine the two ifs with `dyn_cast_or_null`. Though, I also don't think 
a `DeclRefExpr`'s decl can be null in the first place. (If only we could, you 
know, annotate that somehow...)

https://github.com/llvm/llvm-project/pull/108656
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to