Improve loplugin:passstuffbyref

Change-Id: I88ab4c51ff59312127681d3087d22b9c79192b94
This commit is contained in:
Stephan Bergmann
2015-03-03 08:55:35 +01:00
parent 8acdf876c5
commit 24a89b2772
4 changed files with 9 additions and 6 deletions

View File

@@ -47,7 +47,10 @@ bool PassStuffByRef::VisitFunctionDecl(const FunctionDecl * functionDecl) {
}
// only warn on the definition/prototype of the function,
// not on the function implementation
if (functionDecl->isThisDeclarationADefinition() && functionDecl->getPreviousDecl() != nullptr) {
if ((functionDecl->isThisDeclarationADefinition()
&& functionDecl->getPreviousDecl() != nullptr)
|| functionDecl->isDeleted())
{
return true;
}
// only consider base declarations, not overriden ones, or we warn on methods that
@@ -95,7 +98,7 @@ bool PassStuffByRef::VisitLambdaExpr(const LambdaExpr * expr) {
}
bool PassStuffByRef::isFat(QualType type, std::string * name) {
if (!type->isClassType()) {
if (!type->isRecordType()) {
return false;
}
*name = type.getUnqualifiedType().getCanonicalType().getAsString();