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

Restrict loplugin:constparams cast-to-void check

Change-Id: I3c4d4f99b423f46136a79f3b06c5f0e1492872f1
üst 72cfd4d0
...@@ -425,7 +425,13 @@ bool ConstParams::checkIfCanBeConst(const Stmt* stmt, const ParmVarDecl* parmVar ...@@ -425,7 +425,13 @@ bool ConstParams::checkIfCanBeConst(const Stmt* stmt, const ParmVarDecl* parmVar
return false; return false;
} }
if (loplugin::TypeCheck(t).Void()) { if (loplugin::TypeCheck(t).Void()) {
return false; if (auto const sub = dyn_cast<DeclRefExpr>(
e->getSubExpr()->IgnoreParenImpCasts()))
{
if (sub->getDecl() == parmVarDecl) {
return false;
}
}
} }
} }
return checkIfCanBeConst(parent, parmVarDecl); return checkIfCanBeConst(parent, parmVarDecl);
......
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