diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-05 15:16:47 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-06 09:21:58 +0000 |
commit | 0c82dff153d92150729815b919854a9a350aa031 (patch) | |
tree | 9bda3cba13d9534460b2fe7919b00009e8ffd425 /compilerplugins | |
parent | 9458ce11084579b020650fecb1165052c16ee556 (diff) |
loplugin:singlevalfields
Change-Id: Ia681765aa1da5c80a3dbe91b7376af841a9c9ec1
Reviewed-on: https://gerrit.libreoffice.org/36145
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/singlevalfields.cxx | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/compilerplugins/clang/singlevalfields.cxx b/compilerplugins/clang/singlevalfields.cxx index c858954745f9..e096b7f96178 100644 --- a/compilerplugins/clang/singlevalfields.cxx +++ b/compilerplugins/clang/singlevalfields.cxx @@ -465,21 +465,16 @@ std::string SingleValFields::getExprValue(const Expr* arg) if (!arg) return "?"; arg = arg->IgnoreParenCasts(); - // workaround bug in clang - if (isa<ParenListExpr>(arg)) - return "?"; // ignore this, it seems to trigger an infinite recursion - if (isa<UnaryExprOrTypeTraitExpr>(arg)) { + if (isa<UnaryExprOrTypeTraitExpr>(arg)) + return "?"; + if (arg->isValueDependent()) return "?"; - } APSInt x1; if (arg->EvaluateAsInt(x1, compiler.getASTContext())) - { return x1.toString(10); - } - if (isa<CXXNullPtrLiteralExpr>(arg)) { + if (isa<CXXNullPtrLiteralExpr>(arg)) return "0"; - } return "?"; } |