Kaydet (Commit) cd8a4905 authored tarafından Luboš Luňák's avatar Luboš Luňák

compilers don't seem to warn about unused variables in the global scope

And this causes at least some problems with extern variables in headers,
maybe that could be handled, but it probably wouldn't be trivial to
get it exactly right about which location to warn and which ones not.

Change-Id: I8974c9ba9493d09165b026ee7a451238f6d90a30
üst 2acc59ea
......@@ -47,6 +47,8 @@ bool UnusedVariableCheck::VisitNamedDecl( NamedDecl* declaration )
const VarDecl* var = cast< VarDecl >( declaration );
if( var->isReferenced() || var->isUsed())
return true;
if( var->isDefinedOutsideFunctionOrMethod())
return true;
if( CXXRecordDecl* type = var->getType()->getAsCXXRecordDecl())
{
bool warn_unused = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment