diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-10-12 12:59:31 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-10-12 13:10:55 +0200 |
commit | 9c0304f5a725ad0a58afecb96862ecd298ffec06 (patch) | |
tree | f359889010b4b4b0117f0f7b2890b238eb418a2f /compilerplugins | |
parent | loplugin: unused string and misleading if/else indent (diff) | |
download | core-9c0304f5a725ad0a58afecb96862ecd298ffec06.tar.gz core-9c0304f5a725ad0a58afecb96862ecd298ffec06.zip |
do not report unnamed parameters as unused
Change-Id: I0cc44354085fbee15aa94d23c29830fd40e8d939
Diffstat (limited to 'compilerplugins')
-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())) |