summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-07-14 14:36:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-07-17 07:23:22 +0200
commitdb3860062ebf4109f48139c2556ff4041aff5d6e (patch)
treeb6ab4df909c8922e48a9c4eefa9a8f0f6a47c41f /compilerplugins
parent846f557fd591626931a9dadb38180786e090104c (diff)
extend loplugin useuniqueptr to OUString pointers
Change-Id: Ieb5bab3895e1edaff497c4a1a88303ccac097edc Reviewed-on: https://gerrit.libreoffice.org/39948 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/useuniqueptr.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/compilerplugins/clang/useuniqueptr.cxx b/compilerplugins/clang/useuniqueptr.cxx
index dc1371f00b4a..977404ab2ae6 100644
--- a/compilerplugins/clang/useuniqueptr.cxx
+++ b/compilerplugins/clang/useuniqueptr.cxx
@@ -14,6 +14,7 @@
#include <fstream>
#include <set>
#include "plugin.hxx"
+#include "check.hxx"
/**
Find destructors that only contain a single call to delete of a field. In which
@@ -221,7 +222,10 @@ void UseUniquePtr::CheckForDeleteOfPOD(const CompoundStmt* compoundStmt)
auto pointerType = dyn_cast<PointerType>(fieldDecl->getType()->getUnqualifiedDesugaredType());
QualType elementType = pointerType->getPointeeType();
- if (!elementType.isPODType(compiler.getASTContext()))
+ auto tc = loplugin::TypeCheck(elementType);
+ if (!elementType.isPODType(compiler.getASTContext())
+ && !tc.Class("OUString").Namespace("rtl").GlobalNamespace()
+ && !tc.Class("OString").Namespace("rtl").GlobalNamespace())
continue;
StringRef aFileName = compiler.getSourceManager().getFilename(compiler.getSourceManager().getSpellingLoc(fieldDecl->getLocStart()));