From 92dfa82d2d25f2acdee0a538bf15f1fac36c0ecf Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Tue, 23 Jul 2013 09:49:57 +0200 Subject: 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 --- compilerplugins/clang/unusedvariablecheck.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'compilerplugins') diff --git a/compilerplugins/clang/unusedvariablecheck.cxx b/compilerplugins/clang/unusedvariablecheck.cxx index a0763ac2f11d..86f405db0f7c 100644 --- a/compilerplugins/clang/unusedvariablecheck.cxx +++ b/compilerplugins/clang/unusedvariablecheck.cxx @@ -8,6 +8,13 @@ * */ +#include + +// 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 @@ -101,3 +108,5 @@ bool UnusedVariableCheck::VisitVarDecl( const VarDecl* var ) static Plugin::Registration< UnusedVariableCheck > X( "unusedvariablecheck" ); } // namespace + +#endif -- cgit