11 #include "clang/AST/Expr.h"
19 if (
const auto *DRE = dyn_cast<DeclRefExpr>(S))
20 return DRE->getDecl() == Var;
27 if (
const auto *DS = dyn_cast<DeclStmt>(S)) {
28 for (
const Decl *D : DS->getDeclGroup()) {
29 if (
const auto *LeftVar = dyn_cast<VarDecl>(D)) {
30 if (LeftVar->hasInit() && LeftVar->getType()->isReferenceType()) {
35 }
else if (
const auto *UnOp = dyn_cast<UnaryOperator>(S)) {
36 if (UnOp->getOpcode() == UO_AddrOf)
48 for (
const Stmt *Child : S->children()) {