Avoid loplugin:constparam when param is marked as unused

...as in entry_group_callback
(sd/source/ui/remotecontrol/AvahiNetworkService.cxx),

  AVAHI_GCC_UNUSED void *userdata

Change-Id: I494067878181c51b77d581a21ab1c9ef81e482e5
This commit is contained in:
Stephan Bergmann
2017-08-30 16:34:46 +02:00
parent 9540916d82
commit 64a4ad3a67

View File

@@ -194,7 +194,8 @@ bool ConstParams::VisitFunctionDecl(const FunctionDecl * functionDecl)
// calculate the ones we want to check
for (const ParmVarDecl *pParmVarDecl : compat::parameters(*functionDecl)) {
// ignore unused params
if (pParmVarDecl->getName().empty())
if (pParmVarDecl->getName().empty()
|| pParmVarDecl->hasAttr<UnusedAttr>())
continue;
auto const type = loplugin::TypeCheck(pParmVarDecl->getType());
if (!type.Pointer() && !type.LvalueReference())