diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-12-05 10:11:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-12-06 07:42:50 +0100 |
commit | c0ac78c97174fcde68daf174f6e8ade502c507d3 (patch) | |
tree | 800de448258b3fd82d78efdb53d4f5c8eed6cb26 /compilerplugins | |
parent | da85b582656219a0bc9d20cef59ae6b7ee1c4a9b (diff) |
loplugin:salcall handle virtual methods
Change-Id: Iab95db31188ea2914a46d63a7ebef3d825e6ec42
Reviewed-on: https://gerrit.libreoffice.org/45851
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/salcall.cxx | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/compilerplugins/clang/salcall.cxx b/compilerplugins/clang/salcall.cxx index 08b0230a9d49..b36bc5cc1db0 100644 --- a/compilerplugins/clang/salcall.cxx +++ b/compilerplugins/clang/salcall.cxx @@ -206,7 +206,7 @@ bool SalCall::VisitFunctionDecl(FunctionDecl const* decl) // @TODO For now, I am ignore free functions, since those are most likely to have their address taken. // I'll do them later. They are harder to verify since MSVC does not verify when assigning to function pointers // that the calling convention of the function matches the calling convention of the function pointer! - if (!methodDecl || methodDecl->isStatic() || methodDecl->isVirtual()) + if (!methodDecl || methodDecl->isStatic()) return true; // can only check when we have a definition since this is the most likely time @@ -232,6 +232,42 @@ bool SalCall::VisitFunctionDecl(FunctionDecl const* decl) return true; } + // some base classes are overridden by sub-classes which override both the base-class and an UNO class + if (recordDecl) + { + auto dc = loplugin::DeclCheck(recordDecl); + if (dc.Class("OProxyAggregation").Namespace("comphelper").GlobalNamespace() + || dc.Class("OComponentProxyAggregationHelper") + .Namespace("comphelper") + .GlobalNamespace() + || dc.Class("SvxShapeMaster").GlobalNamespace() + || dc.Class("ListBoxAccessibleBase").Namespace("accessibility").GlobalNamespace() + || dc.Class("AsyncEventNotifierBase").Namespace("comphelper").GlobalNamespace() + || dc.Class("ODescriptor") + .Namespace("sdbcx") + .Namespace("connectivity") + .GlobalNamespace() + || dc.Class("IController").Namespace("dbaui").GlobalNamespace() + || dc.Class("ORowSetBase").Namespace("dbaccess").GlobalNamespace() + || dc.Class("OComponentAdapterBase").Namespace("bib").GlobalNamespace() + || dc.Class("IEventProcessor").Namespace("comphelper").GlobalNamespace() + || dc.Class("SvxUnoTextBase").GlobalNamespace() + || dc.Class("OInterfaceContainer").Namespace("frm").GlobalNamespace() + || dc.Class("AccessibleComponentBase").Namespace("accessibility").GlobalNamespace() + || dc.Class("ContextHandler2Helper") + .Namespace("core") + .Namespace("oox") + .GlobalNamespace() + || dc.Class("AccessibleStaticTextBase").Namespace("accessibility").GlobalNamespace() + || dc.Class("OCommonPicker").Namespace("svt").GlobalNamespace() + || dc.Class("VbaDocumentBase").GlobalNamespace() + || dc.Class("VbaPageSetupBase").GlobalNamespace() + || dc.Class("ScVbaControl").GlobalNamespace() + + ) + return true; + } + if (methodDecl) { for (auto iter = methodDecl->begin_overridden_methods(); @@ -351,7 +387,7 @@ bool SalCall::checkOverlap(SourceRange range) return true; } -static loplugin::Plugin::Registration<SalCall> reg("salcall", false); +static loplugin::Plugin::Registration<SalCall> reg("salcall", true); } /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |