summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/unusedvariablecheck.cxx9
1 files changed, 9 insertions, 0 deletions
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 <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