From bf82016b20b9d5da1c3ce06258f77cfc2c66afac Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 26 Jun 2018 14:07:28 +0200 Subject: loplugin:useuniqueptr in SwDoc Change-Id: Ic895c7b79a25a0766cc6d352c5ed75873004fddb Reviewed-on: https://gerrit.libreoffice.org/56496 Tested-by: Jenkins Reviewed-by: Noel Grandin --- compilerplugins/clang/useuniqueptr.cxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'compilerplugins') diff --git a/compilerplugins/clang/useuniqueptr.cxx b/compilerplugins/clang/useuniqueptr.cxx index 131727f0f44f..df6343f61578 100644 --- a/compilerplugins/clang/useuniqueptr.cxx +++ b/compilerplugins/clang/useuniqueptr.cxx @@ -278,6 +278,11 @@ void UseUniquePtr::CheckDeleteExpr(const CXXMethodDecl* methodDecl, const CXXDel auto tc = loplugin::TypeCheck(fieldDecl->getType()); if (tc.Class("map").StdNamespace() || tc.Class("unordered_map").StdNamespace()) return; + // these sw::Ring based classes do not lend themselves to std::unique_ptr management + if (tc.Pointer().Class("SwNodeIndex").GlobalNamespace() || tc.Pointer().Class("SwShellTableCursor").GlobalNamespace() + || tc.Pointer().Class("SwBlockCursor").GlobalNamespace() || tc.Pointer().Class("SwVisibleCursor").GlobalNamespace() + || tc.Pointer().Class("SwShellCursor").GlobalNamespace()) + return; // there is a loop in ~ImplPrnQueueList deleting stuff on a global data structure if (loplugin::isSamePathname(aFileName, SRCDIR "/vcl/inc/print.h")) return; -- cgit