summaryrefslogtreecommitdiff
path: root/compilerplugins/clang
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins/clang')
-rw-r--r--compilerplugins/clang/constparams.cxx3
1 files changed, 2 insertions, 1 deletions
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<UnusedAttr>())
continue;
auto const type = loplugin::TypeCheck(pParmVarDecl->getType());
if (!type.Pointer() && !type.LvalueReference())