Kaydet (Commit) fb2cd383 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Look through ExprWithCleanups etc.

Change-Id: I5c8af20a71eca245c4b2a0061dc0612a4770c8ff
üst 3510a0e2
......@@ -160,7 +160,9 @@ bool UseUniquePtr::VisitCompoundStmt(const CompoundStmt* compoundStmt)
auto varDecl = dyn_cast<VarDecl>(declRefExpr->getDecl());
if (!varDecl)
return true;
if (!varDecl->hasInit() || !dyn_cast<CXXNewExpr>(varDecl->getInit()))
if (!varDecl->hasInit()
|| !isa<CXXNewExpr>(
varDecl->getInit()->IgnoreImplicit()->IgnoreParenImpCasts()))
return true;
// determine if the var is declared inside the same block as the delete.
// @TODO there should surely be a better way to do this
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment