diff options
Diffstat (limited to 'compilerplugins/clang/unusedvariablecheck.cxx')
-rw-r--r-- | compilerplugins/clang/unusedvariablecheck.cxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compilerplugins/clang/unusedvariablecheck.cxx b/compilerplugins/clang/unusedvariablecheck.cxx index f2916320718d..65cac7573588 100644 --- a/compilerplugins/clang/unusedvariablecheck.cxx +++ b/compilerplugins/clang/unusedvariablecheck.cxx @@ -79,6 +79,8 @@ bool UnusedVariableCheck::VisitNamedDecl( NamedDecl* declaration ) { if( const ParmVarDecl* param = dyn_cast< ParmVarDecl >( var )) { + if( !param->getDeclName()) + return true; // unnamed parameter -> unused // If this declaration does not have a body, then the parameter is indeed not used, // so ignore. if( const FunctionDecl* func = dyn_cast< FunctionDecl >( param->getParentFunctionOrMethod())) |