summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/unusedvariablecheck.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-08-04 09:36:32 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-08-04 09:36:32 +0200
commitc15b4cf39a74176cee64795129d76f411d2c0a69 (patch)
treecf03416c9dd4762553e1dc66fdec5ded319c7353 /compilerplugins/clang/unusedvariablecheck.cxx
parentf17f89aadc5e88880df0c852289e2fa5b04254ba (diff)
Adapt to current Clang trunk towards 3.7
Change-Id: Ibb2c641d49a1773be789c9259f53a040db6f605f
Diffstat (limited to 'compilerplugins/clang/unusedvariablecheck.cxx')
-rw-r--r--compilerplugins/clang/unusedvariablecheck.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/compilerplugins/clang/unusedvariablecheck.cxx b/compilerplugins/clang/unusedvariablecheck.cxx
index 0308d9b6150c..9bbb9d5e6ae2 100644
--- a/compilerplugins/clang/unusedvariablecheck.cxx
+++ b/compilerplugins/clang/unusedvariablecheck.cxx
@@ -16,6 +16,7 @@
// (LO classes won't get duplicated warnings, as the attribute is different).
#if !HAVE_GCC_ATTRIBUTE_WARN_UNUSED_STL
+#include "compat.hxx"
#include "unusedvariablecheck.hxx"
#include <clang/AST/Attr.h>
@@ -48,7 +49,13 @@ void UnusedVariableCheck::run()
TraverseDecl( compiler.getASTContext().getTranslationUnitDecl());
}
-bool BaseCheckNotDialogSubclass(const CXXRecordDecl *BaseDefinition, void *) {
+bool BaseCheckNotDialogSubclass(
+ const CXXRecordDecl *BaseDefinition
+#if __clang_major__ == 3 && __clang_minor__ < 7
+ , void *
+#endif
+ )
+{
if (BaseDefinition && BaseDefinition->getQualifiedNameAsString().compare("Dialog") == 0) {
return false;
}
@@ -66,7 +73,7 @@ bool isDerivedFromDialog(const CXXRecordDecl *decl) {
if (// not sure what hasAnyDependentBases() does,
// but it avoids classes we don't want, e.g. WeakAggComponentImplHelper1
!decl->hasAnyDependentBases() &&
- !decl->forallBases(BaseCheckNotDialogSubclass, nullptr, true)) {
+ !compat::forallBases(*decl, BaseCheckNotDialogSubclass, true)) {
return true;
}
return false;