Adapt loplugin:ptrvector to libc++ (on macOS)
...where it produced false positive > /Users/stephan/Software/lo2/core/UnoControls/source/controls/progressmonitor.cxx:245:21: error: do not call operator== on a std container containing a unique_ptr const class std::__1::__wrap_iter<class std::__1::unique_ptr<struct unocontrols::IMPL_TextlistItem, struct std::__1::default_delete<struct unocontrols::IMPL_TextlistItem> > *> [loplugin:ptrvector] > if (itr != maTextlist_Top.end()) > ^ Change-Id: I8a8b6f30145e6aff2caa03c03f0fd20af0ba42b5 Reviewed-on: https://gerrit.libreoffice.org/59181 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
@@ -13,6 +13,8 @@
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <set>
|
||||
|
||||
#include "check.hxx"
|
||||
#include "plugin.hxx"
|
||||
|
||||
/**
|
||||
@@ -54,7 +56,10 @@ bool PtrVector::VisitCXXOperatorCallExpr(const CXXOperatorCallExpr* expr)
|
||||
}
|
||||
const Expr* argExpr = expr->getArg(0);
|
||||
std::string s = argExpr->getType().getDesugaredType(compiler.getASTContext()).getAsString();
|
||||
if (s.find("iterator") != std::string::npos) {
|
||||
if (s.find("iterator") != std::string::npos
|
||||
|| (loplugin::TypeCheck(argExpr->getType()).Class("__wrap_iter").Namespace("__1")
|
||||
.StdNamespace()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (s.find("array") == std::string::npos && s.find("deque") == std::string::npos
|
||||
|
Reference in New Issue
Block a user