loplugin:constantparam

and tweak the plugin to handle a crash seen with clang-9

Change-Id: Ie1ccf80c16a20dbca58e5bd081af13f75cf5ac8f
Reviewed-on: https://gerrit.libreoffice.org/75850
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2019-07-18 11:34:32 +02:00
parent 618baf4c5b
commit cdbe8a8700
24 changed files with 1544 additions and 1719 deletions

View File

@@ -168,9 +168,10 @@ std::string ConstantParam::getCallValue(const Expr* arg)
}
arg = arg->IgnoreParenCasts();
// ignore this, it seems to trigger an infinite recursion
if (isa<UnaryExprOrTypeTraitExpr>(arg)) {
if (isa<UnaryExprOrTypeTraitExpr>(arg))
return "unknown1";
}
if (arg->isValueDependent())
return "unknown2";
APSInt x1;
if (compat::EvaluateAsInt(arg, x1, compiler.getASTContext()))
{