do not report unnamed parameters as unused
Change-Id: I0cc44354085fbee15aa94d23c29830fd40e8d939
This commit is contained in:
@@ -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()))
|
||||
|
Reference in New Issue
Block a user