diff options
author | Noel Grandin <noel@peralex.com> | 2016-07-18 09:03:51 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-07-19 05:39:46 +0000 |
commit | 36313d93ac6f88bb4b4e4ed7109db583c7ce9886 (patch) | |
tree | f27ca9d75beb484a6ce93268fc15a0bfd470e3a1 /compilerplugins | |
parent | a7b5be118191a4e8a6cd422b5b2438a1ac22f36f (diff) |
improve unnecessaryoverride plugin
to ignore ImplicitCastExpr when calling superclass method
Change-Id: I76a3068446acfee85aa1baeb216e57f63c7099c1
Reviewed-on: https://gerrit.libreoffice.org/27279
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/unnecessaryoverride.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/compilerplugins/clang/unnecessaryoverride.cxx b/compilerplugins/clang/unnecessaryoverride.cxx index cd426695cd6b..d77b84f6037c 100644 --- a/compilerplugins/clang/unnecessaryoverride.cxx +++ b/compilerplugins/clang/unnecessaryoverride.cxx @@ -66,6 +66,12 @@ bool UnnecessaryOverride::VisitCXXMethodDecl(const CXXMethodDecl* methodDecl) // not sure what is happening here if (aFileName == SRCDIR "/extensions/source/bibliography/datman.cxx") return true; + // some very creative method hiding going on here + if (aFileName == SRCDIR "/svx/source/dialog/checklbx.cxx") + return true; + // entertaining template magic + if (aFileName == SRCDIR "/sc/source/ui/vba/vbaformatcondition.cxx") + return true; const CXXMethodDecl* overriddenMethodDecl = *methodDecl->begin_overridden_methods(); @@ -133,7 +139,8 @@ bool UnnecessaryOverride::VisitCXXMethodDecl(const CXXMethodDecl* methodDecl) if (!expr2) return true; for (unsigned i = 0; i<callExpr->getNumArgs(); ++i) { - const DeclRefExpr * declRefExpr = dyn_cast<DeclRefExpr>(callExpr->getArg(i)); + // ignore ImplicitCastExpr + const DeclRefExpr * declRefExpr = dyn_cast<DeclRefExpr>(callExpr->getArg(i)->IgnoreImplicit()); if (!declRefExpr || declRefExpr->getDecl() != methodDecl->getParamDecl(i)) return true; } |