loplugin:unusedmethods tweak for less noise

Change-Id: Idedd1680b03f6b62ff80ad7d0fd74c11d1675053
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177533
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2024-11-29 15:06:48 +02:00
parent f4fe6df6aa
commit 27509505be

View file

@ -285,6 +285,8 @@ gotfunc:
logCallToRootMethods(calleeFunctionDecl, usedReturnSet);
return true;
}
if (auto attributedStmt = dyn_cast<AttributedStmt>(parent))
parent = attributedStmt->getSubStmt();
if (isa<Expr>(parent) || isa<ReturnStmt>(parent) || isa<DeclStmt>(parent)
|| isa<IfStmt>(parent) || isa<SwitchStmt>(parent) || isa<ForStmt>(parent)
|| isa<WhileStmt>(parent) || isa<DoStmt>(parent)
@ -298,6 +300,10 @@ gotfunc:
{
return true;
}
report(
DiagnosticsEngine::Warning,
"unknown parent?",
parent->getBeginLoc());
parent->dump();
return true;
}