loplugin:unusedfields
make it a little smarter in dealing with fields that are smart pointers Change-Id: I44072105170882dc29fb19558f1065cffc7e5f11 Reviewed-on: https://gerrit.libreoffice.org/37751 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -259,6 +259,11 @@ bool UnusedFields::VisitMemberExpr( const MemberExpr* memberExpr )
|
||||
if (startswith(name, "read") || name.find(">>=") != std::string::npos)
|
||||
// this is a write-only call
|
||||
;
|
||||
else if (name == "clear" || name == "dispose" || name == "clearAndDispose" || name == "swap")
|
||||
// we're abusing the write-only analysis here to look for fields which don't have anything useful
|
||||
// being done to them, so we're ignoreing things like std::vector::clear, vector::swap,
|
||||
// and VclPtr::clearAndDispose
|
||||
;
|
||||
else
|
||||
bPotentiallyReadFrom = true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user