From 64a4ad3a678e414cccdcc158dbe4c76c4bad3cda Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 30 Aug 2017 16:34:46 +0200 Subject: 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 --- compilerplugins/clang/constparams.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'compilerplugins') diff --git a/compilerplugins/clang/constparams.cxx b/compilerplugins/clang/constparams.cxx index 2a1fc1ff8a2d..f170552ba6de 100644 --- a/compilerplugins/clang/constparams.cxx +++ b/compilerplugins/clang/constparams.cxx @@ -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()) continue; auto const type = loplugin::TypeCheck(pParmVarDecl->getType()); if (!type.Pointer() && !type.LvalueReference()) -- cgit