summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/refcounting.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/refcounting.cxx
parentf17f89aadc5e88880df0c852289e2fa5b04254ba (diff)
Adapt to current Clang trunk towards 3.7
Change-Id: Ibb2c641d49a1773be789c9259f53a040db6f605f
Diffstat (limited to 'compilerplugins/clang/refcounting.cxx')
-rw-r--r--compilerplugins/clang/refcounting.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/compilerplugins/clang/refcounting.cxx b/compilerplugins/clang/refcounting.cxx
index 0ecdf8e8037f..460db1c42489 100644
--- a/compilerplugins/clang/refcounting.cxx
+++ b/compilerplugins/clang/refcounting.cxx
@@ -73,7 +73,17 @@ bool isDerivedFrom(const CXXRecordDecl *decl, const char *pString) {
if (// not sure what hasAnyDependentBases() does,
// but it avoids classes we don't want, e.g. WeakAggComponentImplHelper1
!decl->hasAnyDependentBases() &&
- !decl->forallBases(BaseCheckNotSubclass, static_cast<void*>(const_cast<char*>(pString)), true)) {
+ !compat::forallBases(
+ *decl,
+#if __clang_major__ == 3 && __clang_minor__ < 7
+ BaseCheckNotSubclass,
+#else
+ [pString](const CXXRecordDecl *BaseDefinition) -> bool
+ { return BaseCheckNotSubclass(
+ BaseDefinition, const_cast<char *>(pString)); },
+#endif
+ true))
+ {
return true;
}
return false;