do not report unnamed parameters as unused

Change-Id: I0cc44354085fbee15aa94d23c29830fd40e8d939
This commit is contained in:
Luboš Luňák
2012-10-12 12:59:31 +02:00
parent 49ebf4f91d
commit 9c0304f5a7

View File

@@ -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()))