summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/useuniqueptr.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins/clang/useuniqueptr.cxx')
-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()));