adjust for upstreaming of warn_unused attribute

The warn_unused attribute has been upstream to GCC and Clang, so use it if present.
Still warn about STL types if those do not use it yet (which is the status as of now).

Change-Id: I3c003e44c08d1d141e23bba38cf92e663a5ac353
This commit is contained in:
Luboš Luňák
2013-07-23 09:49:57 +02:00
parent 0d2a7adf4e
commit 92dfa82d2d
4 changed files with 44 additions and 3 deletions

View File

@@ -8,6 +8,13 @@
*
*/
#include <config_global.h>
// If there is support for warn_unused attribute even in STL classes, then there's
// no point in having this check enabled, otherwise keep it at least for STL
// (LO classes won't get duplicated warnings, as the attribute is different).
#if !HAVE_GCC_ATTRIBUTE_WARN_UNUSED_STL
#include "unusedvariablecheck.hxx"
#include <clang/AST/Attr.h>
@@ -101,3 +108,5 @@ bool UnusedVariableCheck::VisitVarDecl( const VarDecl* var )
static Plugin::Registration< UnusedVariableCheck > X( "unusedvariablecheck" );
} // namespace
#endif